Lab 3

The command “>” is used to redirect outputs from the shell. It allows you to name the output file the name goes after the “>” and the original destination is put before the operator. In the example below the output of help for the command echo is displayed as a text file.

Screen Shot 2014-10-28 at 6.08.25 PMScreen Shot 2014-10-28 at 6.02.39 PM

 

The command “<” is used to redirect inputs into the shell. It allows you to choose a file already on the computer and redirect the text of that file into the shell. By using cat in combination with “<” command will read and copy the text into the shell.

Screen Shot 2014-10-28 at 6.15.43 PM

The “|” symbol is used as a pipeline it allows you to redirect the output of one command and pipe it as input to another. In the example below “ls –l” is used to display all files within the home directory and the output of this is piped into the less command.

Screen Shot 2014-10-28 at 7.31.48 PMScreen Shot 2014-10-28 at 7.31.37 PM 

The command “grep” is a program that allows users to find text patterns within files. grep finds the patterns it prints out the lines containing the text that is being looked for.

Screen Shot 2014-10-28 at 6.28.50 PM

 

The command “head” prints the first ten lines of a file.

Screen Shot 2014-10-28 at 6.18.41 PM

The command “tail” prints the last ten lines of a file.

Screen Shot 2014-10-28 at 6.20.00 PM

The command “echo” is used to display a line of text. It is called echo because it echo’s back the text that is written after the command.

Screen Shot 2014-10-28 at 6.22.49 PM

Leave a Reply

Your email address will not be published. Required fields are marked *