There are many types of shells in Unix. The most popular are   bash and tcsh. Personally, I prefer the first one, but the
École Polytechnique installs the second by default in the didactical
computer rooms. In any case one can start either of them by simply
opening a terminal and typing the corresponding name. These notes are
based on the bash shell, but most notions will work on either.
Basic commands:
- cd directoryName: change working
      directory
- pwd: print the working directory
- cat fileName: display the (text)
      file fileName to standard output
- mv file position: move       file to a new position: e.g. mv /etc/hosts .
      moves the file hosts from the directory /etc to the
      current working directory (.)
- cp file position: same as       mv, but copy the file
- rm file: remove file
- rmdir directory: remove an empty
      directory
- grep string file(s): look for
      a string in a set of files: e.g. grep -Hi
	complex * looks in all files in the current directory (*)
      for the string complex ignoring upper/lower case (	-i) and displays the name of the file (-H) as well as
      the line where the match occurs.
Most Unix commands can be ``chained'': the output of a command is read
as the input of the next.
- By default, unix tools send their output messages to the
    standard output stream (stdout) and their error
    messages to the standard error stream (stderr)
- Both streams can be redirected. E.g., to redirect both       stdout and stderr, use:  
 sh -c 'command options arguments > outFile 2>&1'
- The output stream of a command can become the input stream
      of the next command in a chain: e.g. find ~  grep grep .cxx finds all files with extension .cxx in
      all subdirectories of the home directory; the first command
      (find) sends a recursive list across subdirectories of
      the home directory (denoted by ~) to stdout. This
      stream is transformed by the pipe character (|) in the
      standard input (stdin) stream of the following command
      (grep), which filters out all lines not containing
      .cxx. .cxx finds all files with extension .cxx in
      all subdirectories of the home directory; the first command
      (find) sends a recursive list across subdirectories of
      the home directory (denoted by ~) to stdout. This
      stream is transformed by the pipe character (|) in the
      standard input (stdin) stream of the following command
      (grep), which filters out all lines not containing
      .cxx.
Leo Liberti
2008-01-12