Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
root terminal colors[solved]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Jarhead
Guru
Guru


Joined: 26 Mar 2004
Posts: 474

PostPosted: Sat Dec 11, 2004 8:28 pm    Post subject: root terminal colors[solved] Reply with quote

My regular user has different colored text for the various kinds of files in the terminal, but my root user does not. Is there a way to get root to have the different text too? Thanks.
_________________
Hats off to everyone in leadership, developmental, or administrative capacities for Gentoo Linux. Your hard work is very much appreciated.


Last edited by Jarhead on Thu Jan 27, 2005 3:36 am; edited 1 time in total
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Sat Dec 11, 2004 10:47 pm    Post subject: Reply with quote

I'm assuming that root doens't have colors when you use su. In that case if you want colors do this after you su:
Code:
source /etc/profile


If you want to generally set colors for your xterm/aterm or whatever you need to create a .Xdefaults in the home of the user (in this case root) and specify what colors you want.

There should be defaults however, so I think the source /etc/profile is what you are looking for.
Back to top
View user's profile Send private message
bosozoku
Advocate
Advocate


Joined: 11 Jan 2004
Posts: 2431
Location: Roazhon

PostPosted: Sat Dec 11, 2004 10:50 pm    Post subject: Reply with quote

You could put it on your ~/.bashrc.
_________________
Stationlinux.org - Wiki Fvwm FR - Config Fvwm
Back to top
View user's profile Send private message
Jarhead
Guru
Guru


Joined: 26 Mar 2004
Posts: 474

PostPosted: Sun Dec 12, 2004 5:10 pm    Post subject: Reply with quote

running "source /etc/profile" didn't do it. What would I change my /etc/bashrc to? I see where the colors are taken away from root, but I'm no programmer and commenting out the line makes the terminal displeased with me.
_________________
Hats off to everyone in leadership, developmental, or administrative capacities for Gentoo Linux. Your hard work is very much appreciated.
Back to top
View user's profile Send private message
baak6
Tux's lil' helper
Tux's lil' helper


Joined: 30 Aug 2003
Posts: 141

PostPosted: Sun Dec 12, 2004 6:05 pm    Post subject: Reply with quote

Add
Code:

alias ls='--color=tty'

in /etc/profile and do
Code:

source /etc/profile
Back to top
View user's profile Send private message
bosozoku
Advocate
Advocate


Joined: 11 Jan 2004
Posts: 2431
Location: Roazhon

PostPosted: Sun Dec 12, 2004 6:18 pm    Post subject: Reply with quote

Hum this is not very proper !

Edit your .bashrc and add an alias for ls.
Code:
# vim ~/.bashrc

And add this line alias ls="ls --color=auto"
Then you can do a source ~/.bashrc

Finally when you will login as root with su - , ls will do ls --color=auto.
_________________
Stationlinux.org - Wiki Fvwm FR - Config Fvwm
Back to top
View user's profile Send private message
Jarhead
Guru
Guru


Joined: 26 Mar 2004
Posts: 474

PostPosted: Sun Dec 12, 2004 10:22 pm    Post subject: Reply with quote

That did it. Thank you for your help.
_________________
Hats off to everyone in leadership, developmental, or administrative capacities for Gentoo Linux. Your hard work is very much appreciated.
Back to top
View user's profile Send private message
Tamerz
Apprentice
Apprentice


Joined: 29 Apr 2003
Posts: 232
Location: Chicago IL, USA

PostPosted: Thu Dec 16, 2004 9:06 am    Post subject: Reply with quote

Ok but how do you keep the color after exiting and using su again with out doing source ~/.bashrc every single time?
Back to top
View user's profile Send private message
trossachs
Veteran
Veteran


Joined: 22 Jan 2004
Posts: 1204
Location: London

PostPosted: Sun Jan 02, 2005 12:16 pm    Post subject: Reply with quote

Yes I have EXACTLY this prob. When you exit the shell, the changes disappear. Any clues?
Back to top
View user's profile Send private message
Tamerz
Apprentice
Apprentice


Joined: 29 Apr 2003
Posts: 232
Location: Chicago IL, USA

PostPosted: Sun Jan 02, 2005 12:20 pm    Post subject: Reply with quote

I added
Code:
alias d="ls --color"
alias ls="ls --color=auto"
alias ll="ls --color -l"
to /etc/profile and it works fine. Someone above said that isn't the proper way but nobody seems to know the proper way so this is working for me.
Back to top
View user's profile Send private message
trossachs
Veteran
Veteran


Joined: 22 Jan 2004
Posts: 1204
Location: London

PostPosted: Sun Jan 02, 2005 12:53 pm    Post subject: Reply with quote

Have just added this line and it hasn't worked. Did you have to restart something; although unlikely?
Back to top
View user's profile Send private message
trossachs
Veteran
Veteran


Joined: 22 Jan 2004
Posts: 1204
Location: London

PostPosted: Sun Jan 02, 2005 12:55 pm    Post subject: Reply with quote

Sorted, I added this to a new file:

Code:
.bash_profile
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum