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.

  1. 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
  2. using grep, pick out all the lines containing 134.29 from the sample file:


  3. Invert the answer to the above question. That is, pick out all the lines which do NOT contain 134.29

  4. Now display all lines which contain the word work:

  5. Now display all lines which contain the word server:

  6. Display all the lines which contain the word workstation:

  7. If the answers to #6 and #8 did not produce the same result, explain why:


  8. (3 points) What 3 symbols redirect standard output (also known as STDOUT)?

  9. Using a pipe, alter the answer to #6 such that it is sorted by the first column

  10. Using a pipe, alter the answer to #6 such that it is sorted numerically by the second column

  11. 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

  12. remove all duplicate entries from the answer to the previous question:

  13. Use awk to display the first two columns of data from the datafile:

  14. Modify the answer to the previous question such that it is sort by the first column:

  15. Modify the answer to the previous question such that all duplicates are removed:

  16. Now, use the wc command to determine how many lines of data are produced:

  17. Now, use the wc command to print ONLY the number of lines of data are produced:

  18. How many lines of data were produced?
  19. Show the command to find all files on the system which are sockets (type s):

  20. Show the command to find all files on the system owned by user jeremy:

  21. Alter the above question so that all error messages are discarded:

  22. Alter the answer from the previous question so that the results are redirected into the file /tmp/jeremy.out:

  23. Alter the answer from the previous question so that all error messages are redirected into the file /tmp/jeremy.err: