
Important Linux features 223
DONE
INDEX
INDEX
PS1=’\W’
e) certain characters, e.g.:
PS1=hello or PS1=% or PS1=’>’
1
f) a combinations of the items above, e.g.:
PS1=’\h:\w>’
in case of the last example the prompt will look like:
<hostname> : /u/data/guest >
3. save the file and leave the editor
4. log out and log in again to see the effect of the change
The second prompt can be set be defining the variable PS2.
If you want to read the manual pages for the bash, type: man bash
13.4 How to avoid much typing in Linux
13.4.1 General
1. use environment variables, e.g.:
NMR=/opt/topspin/data/usera/nmr
export NMR
these 2 lines can be entered in your file .bashrc
Open a new shell and type cd $NMR to go to the corresponding directory.
2. use Linux functions, e.g.:
data()
{
cd /opt/topspin/data/usera/nmr
}
1. characters which have a special meaning in Linux, e.g. < , >, \ , and ; must be quoted
Commenti su questo manuale