Name:
class section:
Using your browser, save a copy of http://www.linux-classes.com/ccis1121/labs/lab3.datafile into your /tmp directory. Using that datafile, you can complete all questions on this worksheet. Write the correct answer after each question.
- Create a user for the instructor. Username jeremy with password in_class. Make sure that user jeremy is in the wheel group. Get instructor sign-off
- using grep, pick out all the lines containing 134.29 from the sample file:
- Invert the answer to the above question. That is, pick out all the lines which do NOT contain 134.29
- Now display all lines which contain the word work:
- Now display all lines which contain the word server:
- Display all the lines which contain the word workstation:
- If the answers to #6 and #8 did not produce the same result, explain why:
- (3 points) What 3 symbols redirect standard output (also known as STDOUT)?
- Using a pipe, alter the answer to #6 such that it is sorted by the first column
- Using a pipe, alter the answer to #6 such that it is sorted numerically by the second column
- Using a pipe, alter the answer to #6 such that it is reverse sorted numerically (that is, 5 would come before 4) by the third column
- remove all duplicate entries from the answer to the previous question:
- Use awk to display the first two columns of data from the datafile:
- Modify the answer to the previous question such that it is sort by the first column:
- Modify the answer to the previous question such that all duplicates are removed:
- Now, use the wc command to determine how many lines of data are produced:
- Now, use the wc command to print ONLY the number of lines of data are produced:
- How many lines of data were produced?
- Show the command to find all files on the system which are sockets (type s):
- Show the command to find all files on the system owned by user jeremy:
- Alter the above question so that all error messages are discarded:
- Alter the answer from the previous question so that the results are redirected into the file /tmp/jeremy.out:
- Alter the answer from the previous question so that all error messages are redirected into the file /tmp/jeremy.err: