LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 07-12-2003, 12:24 PM   #1
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
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 ?
 
Old 07-12-2003, 12:28 PM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
maybe you could put that command in your .bashrc file.
 
Old 07-12-2003, 12:29 PM   #3
isme
LQ Newbie
 
Registered: Jul 2003
Posts: 12

Rep: Reputation: 0
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
 
Old 07-12-2003, 01:06 PM   #4
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
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?
 
Old 07-12-2003, 01:45 PM   #5
isme
LQ Newbie
 
Registered: Jul 2003
Posts: 12

Rep: Reputation: 0
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.
 
Old 07-14-2003, 05:14 PM   #6
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
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.
 
Old 07-15-2003, 02:25 AM   #7
isme
LQ Newbie
 
Registered: Jul 2003
Posts: 12

Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
root question manicman Linux - Newbie 2 11-03-2005 04:20 AM
root question. ratatat Linux - Newbie 7 12-27-2004 02:57 PM
Root question RockmanExe Mandriva 5 08-29-2003 03:43 PM
root question? indy317 Linux - General 5 05-20-2003 03:43 PM
root question spuppett Linux - General 4 03-01-2003 05:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration