Menu

Intro to Unix Project 2

Colorado Technical University Instructor Jeffery Scheetz Phase 2 Individual Project Intro to UNIX CS126 Denver, Colorado 10/17/11 1- Description of filters: Is a small and usually specialized program in UNIX-like operating systems that transform plain text data in some meaningful way be used other filters and pipes to form a series of operations that produce highly specific results. The three standard files every filter uses are * Standard input. * Standard output. * Standard error. 2- Description of pipes: The symbol | is the Unix pipe symbol that is used on the command line.

What it means is that the standard output of the command to the left of the pipe gets sent as standard input of the command to the right of the pipe. Note that this functions a lot like the > symbol used to redirect the standard output of a command to a file. However, the pipe is different because it is used to pass the output of a command to another command, not a file. 3- Description of redirection: Redirection is usually thought of in terms of redirection operators, which can be used to switch both the source and the destination of standard streams of data in commands. They can be classified as input, output, error and pipe.

Redirection operators are formed mainly from three characters: the leftward pointing angle bracket ( < ), the rightward pointing angle bracket ( > ) and the vertical bar ( | ). In some cases the ampersand ( & ) and the numeral 2 are also used. ls /etc * In the first step, I typed this command ls /etc then hit enter. A huge list of all the files in alphabetical order popped out. when I typed ls, I asked to give me the lists of the files in the current directory. ls /etc | grep conf * Ls /etc | grep conf, when I entered that and hit enter, it replied that: “No such file or directory”.

That means that I asked for a file name grep conf, but is not available. * grep means: is to display lines that match a pattern. Ls /etc | grep conf | grep -v “. ” * Ls /etc | grep conf | grep -v “. ” When I entered this command, it replied: gconf, then in a new line: resolvconf. I’m not sure what’s that means, I guess that it means that this file got resolved and found!! Ls /etc | grep conf | grep -v “. ” | sort > ~/conf * Ls /etc | grep conf | grep -v “. ” | sort > ~/conf . After I typed the hall command and hit enter, nothing came out or didn’t give me any results. > this command means that: redirect output to a storage file. cat /etc * Cat /etc: after I typed this command, it replied that cat: /etc: is a directory. cat /etc/passwd * cat /etc/passwd: after I entered that, a huge lists of password came out. Cat command is usualy used to read files. Cat also can displays file without stopping. * The command passwd means: is that I need to change the password, which is that I should do regualary. Cat /etc/passwd | awk –F”:” ‘{print $1}’ * Cat /etc/passwd | awk –F”:” ‘{print $1}’ * After I entered this command awk –F”:” it means that I wanted a pattern scanning and processing language.

Then I ordered to print one copy. cat /etc/passwd | awk -F”:” ‘{print $1}’ | sort >> ~/users 2>&1 * cat /etc/passwd | awk -F”:” ‘{print $1}’ | sort >> ~/users 2>&1 When I typed the hall command as shown on the top and on the consol, nothing came out. what I think I asked by writing this command to sort and print the output immediately. References: Retrieved from: School Of Earth of Sciences http://pangea. stanford. edu/computing/unix/shell/commands. php Retrieved from: Intro to UNIX http://www. december. com/unix/tutor/pipesfilters. html

0 Comment

Leave a Reply

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