Phase 2 - Individual Project

Submitted by: Submitted by

Views: 10

Words: 308

Pages: 2

Category: Science and Technology

Date Submitted: 05/01/2016 01:42 PM

Report This Essay

1. A filter is a program Unix uses to transform data which comes in text into something that can then be used with other filters in a way that works for specific results. Cat, awk and sort are examples or filters that are standard.

2. Pipes are filters which have been placed side by side in Unix using the I sign. Pipes give filters more specific results.

3. When you specify the destination in the command line you can redirect the input/output of something like a file using a redirection metacharacter followed by the destination

ls /etc | grep conf | grep -v "/." | sort > ~/conf

cat /etc/passwd | awk -F":" '{print $1}' | sort >> ~/users 2>&1

4. The commands above show us different things. The first command : ls /etc | grep conf | grep –v “/”.| sort > ~/conf can be broken down this way. Ls /etc allows the system to list the contents that are inside the directory ETC. The | then shows us that it is piped with grep conf which then filters down the results which contain the phrase conf. Then the pipe goes to grep –v “/” which will send the search to find any phrases of conf without a period. The end of the command then pipes with sort > ~/conf what puts the whole things in alphabetical order and will create a file in the home directory ~/conf.

5. The second command has cat /etc/passwd will display all of the content in the file of /etc/passwd. This is then piped with awk –F”:” ‘{print $1}’ which the awk then has –F put a space in. “:” is a field operator and the ‘{print $1}’ then will print the first field of each line that follows. At the end, sort >> ~/users will then send all of the information to place that all of the standard output data would go.