
456
|
Chapter 3: Linux Commands
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
tac
tac [options] [file]
Named for the common command cat, tac prints files in reverse to
standard output. Without a filename or with -, it reads from stan-
dard input. By default, tac reverses the order of the lines, printing
the last line first.
Options
-b, --before
Print separator (by default a newline) before the string it
delimits.
-r, --regex
Expect separator to be a regular expression.
-s string, --separator=string
Specify alternate separator (default is newline).
--help
Print a help message and then exit.
--version
Print version information and then exit.
tail
tail [options] [files]
Print the last 10 lines of each named file (or standard input if - is
specified) on standard output. If more than one file is specified, the
output includes a header at the beginning of each file:
= =>filename<= =
For options that take the number of bytes or lines as an argument,
you prepend a plus sign (+) to num to begin printing with the
numth item. These options can also specify a block size:
b 512 bytes
k 1 kilobyte
m 1 megabyte
Options
-c num, --bytes num
Print the last num bytes.
-f, --follow[=name|descriptor]
Don’t quit at the end of file; “follow” file as it grows and end
when the user presses Ctrl-C. Following by file descriptor is
the default, so -f, --follow, and --follow=descriptor ...