Linux Tricks: Tty Mode
Linux Tricks: Tty Mode
TTY MODE
$ echo $PS1
[\u@\h \W]$
\h: the hostname up to the first dot (.) in the Fully-Qualified Domain
Name.
As good as it looks, this customization will only last for the current user
session. If you close your terminal or exit the session, the changes will
be lost.
In order to make these changes permanent, you will have to add the
following line to ~/.bashrc or ~/.bash_profile depending on your
distribution:
vi ~/.bashrc
vi ~/.bashrc
Some nice color choices (in this case 0;35 it is purple) are:
Blue = 34
Green = 32
Cyan = 36
Red = 31
Purple = 35
Brown = 33
Yellow = 1;33
White = 1;37
Black = 30
1 = bold
4 = underlined
5 = flashing text
7 = reverse field
40 = black background
41 = red background
42 = green background
43 = orange background
44 = blue background
45 = purple background
46 = cyan background
47 = grey background
31 = red
32 = green
33 = orange
34 = blue
35 = purple
36 = cyan
37 = grey
90 = dark grey
91 = light red
92 = light green
93 = yellow
94 = light blue
95 = light purple
96 = turquoise
di=1;4;31;42
You can also change other kinds of files when using the ls command by
defining each kind with:
di = directory
fi = file
ln = symbolic link
pi = fifo file
so = socket file
After changing the bashrc file, you can activate your changes by
entering:
source ~\.bashrc