To Index

 Documented in Volume 1 of the UNIX Programmers Manual.


 % cat filename
  lists the entire contents of filename at the terminal.


 % cat -n filename > outfile
  copies the contents of file 'filename' into 'outfile'.
  The -n causes line numbers to appear in the output file.


 % cat file1 file2 >file3
  concatenates the first two files and places the result on the third.

  WARNING: Beware of 'cat a b >a' and 'cat a b >b'
  which destroy the input files BEFORE reading them.


 % cat -v printfile
  lists as above, but causes 'non-printing' characters to be listed in a
  visible way.


 % cat - x - y > z
  will A: accept input from the terminal until a CTRL-D and store it in
 	file "z"
       B: list the contents of file "x" and append it to file "z"
       C: input data from the terminal until a CTRL-D and append it
 	to file "z"
       D: list the contents of file "y" and append it to file "z"
 
  The net effect is to interleave keyins and files together!

To Index