View previous topic :: View next topic |
Author |
Message |
Jarhead Guru
Joined: 26 Mar 2004 Posts: 474
|
Posted: Sat Dec 11, 2004 8:28 pm Post subject: root terminal colors[solved] |
|
|
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 |
|
|
mikegpitt Advocate
Joined: 22 May 2004 Posts: 3224
|
Posted: Sat Dec 11, 2004 10:47 pm Post subject: |
|
|
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 |
|
|
bosozoku Advocate
Joined: 11 Jan 2004 Posts: 2431 Location: Roazhon
|
|
Back to top |
|
|
Jarhead Guru
Joined: 26 Mar 2004 Posts: 474
|
Posted: Sun Dec 12, 2004 5:10 pm Post subject: |
|
|
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 |
|
|
baak6 Tux's lil' helper
Joined: 30 Aug 2003 Posts: 141
|
Posted: Sun Dec 12, 2004 6:05 pm Post subject: |
|
|
Add
Code: |
alias ls='--color=tty'
|
in /etc/profile and do
Code: |
source /etc/profile
|
|
|
Back to top |
|
|
bosozoku Advocate
Joined: 11 Jan 2004 Posts: 2431 Location: Roazhon
|
Posted: Sun Dec 12, 2004 6:18 pm Post subject: |
|
|
Hum this is not very proper !
Edit your .bashrc and add an alias for ls.
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 |
|
|
Jarhead Guru
Joined: 26 Mar 2004 Posts: 474
|
Posted: Sun Dec 12, 2004 10:22 pm Post subject: |
|
|
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 |
|
|
Tamerz Apprentice
Joined: 29 Apr 2003 Posts: 232 Location: Chicago IL, USA
|
Posted: Thu Dec 16, 2004 9:06 am Post subject: |
|
|
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 |
|
|
trossachs Veteran
Joined: 22 Jan 2004 Posts: 1204 Location: London
|
Posted: Sun Jan 02, 2005 12:16 pm Post subject: |
|
|
Yes I have EXACTLY this prob. When you exit the shell, the changes disappear. Any clues? |
|
Back to top |
|
|
Tamerz Apprentice
Joined: 29 Apr 2003 Posts: 232 Location: Chicago IL, USA
|
Posted: Sun Jan 02, 2005 12:20 pm Post subject: |
|
|
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 |
|
|
trossachs Veteran
Joined: 22 Jan 2004 Posts: 1204 Location: London
|
Posted: Sun Jan 02, 2005 12:53 pm Post subject: |
|
|
Have just added this line and it hasn't worked. Did you have to restart something; although unlikely? |
|
Back to top |
|
|
trossachs Veteran
Joined: 22 Jan 2004 Posts: 1204 Location: London
|
Posted: Sun Jan 02, 2005 12:55 pm Post subject: |
|
|
Sorted, I added this to a new file:
|
|
Back to top |
|
|
|