Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
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 ?
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
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?
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.
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.
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.