SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've noticed that when im running Konsole in KDE the colors for different file types / folders dissapear when I su to root. After su'ing, every filetype, folder is displayed using the same color. When I exit out of the su, it returns to the normal color.
Is this normal? What is the logic behind that? I guess more importantly, how do I get the cool colors back as root?
What I've done to get a consistent look when su'ing is to source the /etc/profile file as the very first command in a user's and root's ~/,bashrc file.............So the very first command is:
Code:
source /etc/profile
This way, all the global, or system-wide environment for everyone is placed in the /etc/profle file..............If I want to customize something for a specific user or root, then it goes into that user's ~/.bashrc file.................Also, whenever you su to root or another user, the .bashrc file in that user's home directory gets read, which then rereads /etc/profile because of the 'source' command...........
There's a big difference using "su" as opposed to "su -" --- the latter will receive all of the purdy colors from the root login (as well as other aliases you've set up), whereas the former is merely a little quickie step into rootville and so doesn't.
I added "source /etc/profile" and "source ~/.bashrc" to the .bashrc file in /root and now Slackware's sayings are all scrolling down the screen when I try to su to root.
I can probably just delet /root/.bashrc and start over, but what caused this?
Originally posted by mooreted I added "source /etc/profile" and "source ~/.bashrc" to the .bashrc file in /root and now Slackware's sayings are all scrolling down the screen when I try to su to root.
I can probably just delet /root/.bashrc and start over, but what caused this?
you sourced .bashrc in .bashrc? I've never tried that, but as a wild guess that's part of the problem it seems that you might be in a loop, sourcing /etc/profile and .bashrc
slackware sayings? I guess you mean the BSD fortunes? if so, they are called from /etc/profile, which has this section by default:
Quote:
# Append any additional sh scripts found in /etc/profile.d/:
for file in /etc/profile.d/*.sh ; do
if [ -x $file ]; then
. $file
fi
done
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.