- cd directory name - (change directory) used for changing the current working directory. If no directory names are given, then the working directory will be changed to home directory.
- pwd - (print working directory) tells in which directory we currently are.
- 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
green: verde
blue: azul
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 -l - 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 3 lines, 6 words, and 34 characters ("letters").
- grep white dict - looks for the word green 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 -l dict dict2 - be sure that dict2 was there.
cat dict2 - be sure that the content is correct.
- rm dict2 - remove the file dict2.
Cem Ozdogan
2010-02-18