Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ tail(1) — SunOS 5.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cat(1)

head(1)

more(1)

pg(1)

tail(1)

dd(1M)

environ(5)

tail(1)

NAME

tail − deliver the last part of a file

SYNOPSIS

tail [ ± number [ lbcr ]] [ filename ]
tail [ −lbcr ] [ filename ]
tail [ ± number [ lbcf ]] [ filename ]
tail [ −lbcf ] [ filename ]

AVAILABILITY

SUNWcsu

DESCRIPTION

tail copies the named file to the standard output beginning at a designated place.  If no file is named, the standard input is used. 

Copying begins at distance +number from the beginning, or −number from the end of the input (if number is null, the value 10 is assumed).  Number is counted in units of lines, blocks, or characters, according to the appended option l, b, or c.  When no units are specified, counting is by lines. 

The r and f options are mutually exclusive. 

OPTIONS

−l Units of lines. 

−b Units of blocks. 

−c Units of characters. 

−f With the −f (follow) option, if the input-file is not a pipe, the program will not terminate after the line of the input-file has been copied, but will enter an endless loop, wherein it sleeps for a second and then attempts to read and copy further records from the input-file.  Thus it may be used to monitor the growth of a file that is being written by some other process. 

−r The r option copies lines from the specified starting point in the file in reverse order.  The default for r is to print the entire file in reverse order. 

EXAMPLES

For example, the command:

example% tail −f fred

will print the last ten lines of the file fred, followed by any lines that are appended to fred between the time tail is initiated and killed.  As another example, the command:

example% tail −15cf fred

will print the last 15 characters of the file fred, followed by any lines that are appended to fred between the time tail is initiated and killed. 

ENVIRONMENT

If any of the LC_∗ variables ( LC_CTYPE, LC_MESSAGES, LC_TIME, LC_COLLATE, LC_NUMERIC, and LC_MONETARY ) (see environ(5)) are not set in the environment, the operational behavior of tail for each corresponding locale category is determined by the value of the LANG environment variable.  If LC_ALL is set, its contents are used to override both the LANG and the other LC_∗ variables.  If none of the above variables is set in the environment, the "C"  (U.S. style) locale determines how tail behaves. 

LC_CTYPE
Determines how tail handles characters. When LC_CTYPE is set to a valid value, tail can display and handle text and filenames containing valid characters for that locale.  tail can display and handle Extended Unix Code (EUC) characters where any individual character can be 1, 2, or 3 bytes wide.  tail can also handle EUC characters of 1, 2, or more column widths. In the "C" locale, only characters from ISO 8859-1 are valid. 

LC_MESSAGES
Determines how diagnostic and informative messages are presented. This includes the language and style of the messages, and the correct form of affirmative and negative responses.  In the "C" locale, the messages are presented in the default form found in the program itself (in most cases, U.S. English).

SEE ALSO

cat(1), head(1), more(1), pg(1), tail(1), dd(1M), environ(5)

NOTES

Tails relative to the end of the file are stored in a buffer, and thus are limited in length.  Various kinds of anomalous behavior may happen with character special files. 

The tail command will only tail the last 4096 bytes of a file regardless of its line count. 

Sun Microsystems  —  Last change: 14 Sep 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026