COP 3344-01 Introduction to Unix: Lecture 4

Learning objectives

After this class, you should be able to:

  1. Use the following Unix commands: cmp, cut, diff , gunzip, gzip, head, sort, tail, tar, and wc.
  2. Compare two (possibly binary) files to determine if they are different using cmp.
  3. Find out how two files differ using diff.
  4. Extract some text from each line of a file using cut.
  5. Read the first few lines or last few lines of a file using head or tail respectively.
  6. Sort a file using sort.
  7. Count the number of words and lines in a file using wc.
  8. Archive files using tar, and extract files from the archive.
  9. Compress and uncompress files using gz.
  10. Redirect standard input, standard output (including appending to a file), and standard error.
  11. Combine commands using pipes.
  12. Group commands using '(', ')', and ';'.

Reading assignment

  1. JEA: Chapters 10-11, 23.9-23.14, Single Unix Specification for definitions of the commands.
  2. Lecture slides: Lecture4.

Exercises and review questions


Last modified: 24 Sep 2007