cat   more   head   tail
sort   grep   wc   spell

Text File Filters

The following commands work with text files only.


cat

Catenate means ``to connect in a series''. The cat command displays the contents of a text files. If more than one file is placed in the command line then the files are displayed in sudcession. It is here that cat derives its name. With the use of the redirection operator, multiple files can be placed within a single file. Examples:

more

If a file is long (more than 20 lines) then cat is the wrong command for displaying. Instead, use more, which displays the contents of the file one screenful at a time: Press the spacebar to advance by one screenful. Press the Return key to advance by only one line. Press the Q key to quit.


head

To display only the first 10 lines of a text file, use head. Using a simple option, you can display more or less than 10 lines. Examples:

tail

Similar to head, the command tail displays the final 10 lines of a text file: Examples:


sort

The command sort rearranges the lines of text in ASCII order -- digits come before uppercase letters, which come before lowercase letters... There are lots of important options which refine the sorting criteria; read the manual page for sort. Examples:


grep

Weird name -- great tool!! The command grep is used to cull the lines of a file which contain a given string. Read the manual page for grep for all the variations. Examples:


wc

wc stands for ``word count'', and tells you the number of lines, the number of "words" (blocks of characters separated by whitespace), and the total number of characters in the file. Examples:


spell

The spell commands filters through a file looking for things that look like words, and spits out those which don't appear in the computers dictionary file. Examples: