LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   root question (https://www.linuxquestions.org/questions/linux-general-1/root-question-72149/)

Xris718 07-12-2003 12:24 PM

root question
 
Hi guys

A simple question ... when you change into being root and you issue an ls command you get a list of different files. However these different files are listed in different colors. Is there any way to change that so whenever you do ls and you are root the list of different files have only one color? Every time i change into root i have to issue this command "unalias ls" and i dont wanna have to do that every single time. So is there a file you edit ?

DrOzz 07-12-2003 12:28 PM

maybe you could put that command in your .bashrc file.

isme 07-12-2003 12:29 PM

look into /root/.bashrc, /root/.bash_profile or the systemwide equivalents in /etc/bashrc, /etc/bash_profile.
these files are loaded (sourced), when you use a login-shell.
in there you will find the color settings. just comment them out (#) to get rid of the colored console. anyway, I find those colors really helpful ;)

Xris718 07-12-2003 01:06 PM

i looked into /root/bashrc and i dont see any aliases for colors neither does /root/.bash_profile or the /etc/bashrc or /etc/bash_profile have anything regarding roots colors. Is there maybe some hidden file that refers to root like some alias file in the system that has these settings for colors?

isme 07-12-2003 01:45 PM

First, you can see 'hidden files', when you call 'ls -a'.
What Distro do you use?
Normally in one of these files must be something like
'ls='ls --color=auto'' or 'eval dircolors' or similar.
Anyway, as DrOzz said, just add the 'unalias' command in one of these files and it should work also.

Xris718 07-14-2003 05:14 PM

the thing is inside my .bashrc file i have unalias ls and vi and what not and for my profile it works. I tried same thing for root profile putting unalias ls and unalias vi into /root/.bashrc and for some reason it doesnt work. And so im still stuck with constantly issuing unalias vi ls command after i su into root. Any more ideas would be great. :)

isme 07-15-2003 02:25 AM

Try to su to root with 'su -'.
If this not helps, do a 'source ~/.bashrc' to see if your commands work correct.
Could it possible, that you have somewhere an alias similar to
'alias su="su -m or -p"'? This would preserve the shell form being changed, and so, your root's bashrc would never be read (but I can't really think, that this is the reason)
Do you also have one of the files in root's home directory?
~/.bash_profile, ~/.bash_login or ~/.profile ? If so, add the above source command to them (the bash only reads the first file, that occures).

Hope that helps


All times are GMT -5. The time now is 02:24 PM.