To Index

 Documented in Volume 1 of the UNIX Programmers Manual.


 % tail filename
  will list the last ten lines of filename.


 % tail +95 100linefile
 
    -and-

 % tail -5  100linefile
 
  are equivalent and list the last five lines of a hundred line file.


 % tail -r filename
  lists the file backwards.

  BUGS:
  1) the man page for tail states that the entire file will be listed;
  in fact, tail stops after listing only about 128 lines. If the file
  you want to list in reverse order is longer than 128 lines, try:

 	% cat -n filename | sort -nr | sed "s/^.......//"
 
 			-or-

 	% ( echo 'g/^/m0' ; echo '%p' ) | ex filename
 
  2) tail will process only the first file named as an argument.

  Flags l, b, and c specify counting by lines, blocks, or characters.
  Flag  f will continue to read in hopes the file will grow.

To Index