Next 15.A: Viewing Files with head  Prev 14.B: xmaple  Contents

Specialized

§ 15: Unix File Manipulation Utilities


One of the best features of unix is the very wide variety of ways to manipulate files (and data streams-which which will be discussed later). You have already seen some of many kinds the commands that can be used with files: list, copy, move, remove, view, edit and print commands. Unix, in all of its varieties, has many more commands, and variations on them, than most users will ever want to know about. If you ever need a command that will do something obscure, check the manuals and the man pages, you may find a command that will do exactly what you want.

This section covers some of the file commands and utilities commonly (although not as frequently as those discussed earlier) used by scientists. It will start with the cat and head commands, which can both be used to view files. Cat can also be used to create files and to group several files into one.

Next the functions of the special symbols <, >, >> and | will be discussed. You have seen some of these symbols before. Here you can learn more about what they do and how they can be used.

Finally the file utilities, find, grep, sort and diff will be discussed. These utilities allow you to quickly search and compare files in ways that would be painstaking and time consuming by hand.

  1. Viewing Files with head
  2. The cat Command
  3. Redirecting Input and Output with < and >
  4. Redirecting Standard Output to the End of a File (Appending) with >>
  5. Piping with |
  6. Finding Files with find
  7. Searching Files with egrep
  8. Sorting Files with sort
  9. Comparing Files with diff and cmp


Next 15.A: Viewing Files with head  Prev 14.B: xmaple  Contents

Comments and questions to Dr. Elias N. Houstis at enh@cs.purdue.edu.