Next: Directories
Up: Commands
Previous: Simple Commands
- cd - (change directory) used with no arguments takes us from wherever we might be to our home directory.
- pwd - (print working directory) tells in which directory we find ourselves for the moment.
- echo $HOME - Note that echo $HOME has exactly the same effect as pwd. Figure out what your home directory is. Now, What is $HOME?
- cat dict
red: rojo
yellow: amarillo
black: negro
white: blanco
blue: azul
green: verde
control-d
By control-d we mean: hold the control key down; while it is down press "d". We have just used cat to create a short English-Spanish dictionary. This dictionary resides in the file dict.
- ls -al dict - lists the files in the current directory. For the moment there is only one, namely dict.
- cat dict - shows us what is in dict.
- wc dict - counts words (and more). In the case at hand it tells us that dict contains 6 lines, 12 words, and 78 characters ("letters").
- grep white dict - looks for the word white in the file dict and displays the lines in which this word appears. It gives us a way to search through files.
- sort dict - command does just what it says.
- sort dict dict2 - the use of the "into" symbol "". In our example it had the effect of directing the output of the sort command from the screen to the file dict2.
ls -al dict dict2 - be sure that dict2 was there.
cat dict2 - be sure that the content is correct.
- rm dict2 - remove the file dict2.
Next: Directories
Up: Commands
Previous: Simple Commands
Cem Ozdogan
2009-07-03