Core Unix Commands

`$\vert$' ties stdout to stdin
`$<$' redirects stdout to stdin
`$>$' redirects stdout to a file

stdout stands for standard output, which you can normaly see in the terminal stdin means the standard input. In case of `$\vert$' you pipe the standard output directly in the following program where it acts as a standard input, the programs are chained together.

For more information regarding this commands prepend -help

    $ rm --help
Try a few commands on your own, e.g.
    $ ls > file_list
    $ less file_list
    $ rm file_list
    $ ls | less

Here the stdout from the ls command was written to a file called file_list. The next command shows the content of file_list. We quit less by pressing the q key and removing the file. ls $\vert$ less pipes the output in the less program without writing it to a file.

Now we create our working directory including subfolders and our first sequence file using the commands we just learned. Have in mind that you create a good structure so you can find your data easily.

First find out in which directory your are in by typing

	$ pwd
It should look similar to
	$ /home/YOURUSER
To insure yourself, that you are in the correct directory type (~is the shortcut for the home-directory)
	$ cd ~
Now create a new folder in your home directory
	  $ mkdir -p ~/Tutorial/data
	  $ cd ~/Tutorial/data
	  $ echo ATGAAGATGA > FOO.seq
Here we created two new folders in our HOME, Tutorial and a subfolder called data, then we jumped to the data-folder and wrote a short DNA sequence to the FOO.seq file.

For further processing we need a RNA sequence instead of an DNA sequence, so we need to replace the T by an U by executing following command using sed (the stream editor).

	  $ sed -i 's/T/U/g' FOO.seq
The program is called via sed, -i tells sed to replace the existing file (in this case FOO.seq). s stands for substitute T by U and g tells sed to replace all occuring T's in the file globaly).

When we look at our file using less we should see our new sequence ``AUGAAGAUGA''

	  $ less FOO.seq

Sven Findeiss 2013-11-22