LinuxMall.com Got Linux? CD Offer
Newbie's Linux Manual
Putting Life Into Your Terminal
by Laurence Hunter
[ Home ] [ Contents ] [ Download*] [ Previous ] [ Next ]
* In Linux enter: unzip nlm.zip
Red = Danger: Customising Your Prompt

I love this one. Makes your terminal look very cool. It will display the account your logged into in blue, followed by full path of your current directory (no more need for pwd). But here's the nifty bit, whenever you're root, root is displayed in red to constantly warn you!

- 1 -

Enter:

su -c 'pico /etc/bashrc'

...followed by the root password.

- 2 -

Add the following to the end of the file:


if [ $USER = 'root' ] ; then COLOUR=41 # red else COLOUR=44 # blue fi STYLE='m' # Default grey text. # STYLE=';1m' # Bright white text. export PS1="\[\033[$COLOUR;37$STYLE\]$USER:\[\033[37;40$STYLE\]\w\\$ "

- 3 -

Press Ctrl+D to log-out and log-in as a user.

A Cool Message Every Time You Log-in!

- 1 -

Enter:

su -c 'pico /etc/profile'

...followed by the root password.

- 2 -

Add the following to the end of the file:


# Call Fortune program, if available. if [ -x /usr/games/fortune ] ; then echo ; /usr/games/fortune ; echo fi

...and press Ctrl+O to save and Ctrl+X to exit.

Now every time you log-in you'll be greeted by a cool message.

[ Home ] [ Contents ] [ Download*] [ Previous ] [ Next ]
* In Linux enter: unzip nlm.zip

W W W . L I N U X D O T . O R G

The Newbie's Linux Manual is reproduced on LinuxMall.com by permission. The Newbie's Linux Manual is written and maintained by Laurence Hunter. You can find much more of Laurence's work at his site: www.Linuxdot.org

© 1999 Linuxdot.org | Manual's Copyright Terms