
222 Important Linux features
DONE
INDEX
INDEX
• How to repeat and change a previously entered command
1. use the arrow keys to get a command back
2. use the arrow keys to move around in the line
use Control-a to move to the beginning of the line
use Control-e to move to the end of the line
3. change the command according to your needs
4. hit the Enter key to execute the command
• How to search for previously entered commands:
type Control-r and enter a string or keyword to search for the last command
containing that string by typing Control-r again, you can search for earlier
commands containing the same string
• Use <TAB> key for filename/command completition:
Not sure how File or command is written? Just enter the first characters and press
<TAB> key, e.g. :
vi /etc/X11/xo<TAB> -> vi /etc/X11/xorg.conf
• How to set the prompt in the bash
The prompt can be changed by defining the environment variable PS1.
1. type cd to change to your home directory
2. edit (e.g. with vi) the file .profile and set PS1; you can include several
items into the prompt, e.g.:
a) the hostname of the computer:
PS1=’\h’
b) the logname of the user:
PS1=’\u’
c) the current directory:
PS1=’\w’
d) the last part of the current directory:
Komentarze do niniejszej Instrukcji