Ask Your Question
1

Terminal Colors

asked 2012-01-30 13:38:22 -0600

atobi gravatar image

updated 2014-09-28 19:14:30 -0600

mether gravatar image

Hi,

I'm currently have two profiles in my terminal: the Default and a "root" (different colors) I created for when I'm switching to ... yes, root. I made this so I remember I'm root and don't compile/make/... It happened (a lot).

Now, I still have to switch manually to that profile. But also that I do forget once and a while; so I would like my terminal to switch automatically to the "root" profile when I switch to root.

Is this possible and how? :)

Many thanks,

Glenn

edit retag flag offensive close merge delete

5 Answers

Sort by ยป oldest newest most voted
2

answered 2012-01-30 13:58:28 -0600

KevinA gravatar image

Glenn, What is the difference between the two profiles? Is it just colors of the prompt or colors of all the text within the terminal? If it is the color of the terminal prompt then you should be able to modify the .bashrc belonging to root and set the PS1 variable to set the prompt how you would like it to appear. The link below has more information on customizing the terminal prompt color.

http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/

edit flag offensive delete link more
0

answered 2012-01-30 14:01:00 -0600

Orestes910 gravatar image

Most of whats explained here should be applicable to your situation.

Best of luck!

edit flag offensive delete link more
0

answered 2012-01-30 14:01:49 -0600

I personally put my root preferences in /root/.bashrc

edit flag offensive delete link more
0

answered 2012-01-30 22:44:00 -0600

FranciscoD_ gravatar image

Well, the solution would be to not stay logged in as root all the time ;)

Use the 'su -c <command>' format. It is always preferred.

edit flag offensive delete link more
0

answered 2012-01-31 10:46:30 -0600

bigben87 gravatar image

updated 2012-01-31 10:53:38 -0600

If you have trouble remembering which user you currently are, why not stop switching users altogether? Install sudo via su -c 'yum install sudo' and disable the root account via su -c 'passwd -l root'.

If you prefer su -c '<command>' over sudo <command>, you might just change your behavior, as suggested by FranciscoD_.

edit flag offensive delete link more

Comments

Please google su vs sudo and read.

FranciscoD_ gravatar imageFranciscoD_ ( 2012-01-31 13:28:22 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-01-30 13:38:22 -0600

Seen: 7,807 times

Last updated: Jan 31 '12