|HP-UX Reference > T
tail(1)HP-UX 11i Version 3: February 2007
tail — deliver the last part of a file
tail copies the named file to the standard output beginning at a designated place. If no file is named, standard input is used.
tail can be used in three forms as indicated above:
tail with no options specified is equivalent to tail -n 10....
Options and Command-Line Arguments
tail recognizes the following options and command-line arguments:
If the -c option is specified, the input file can contain arbitrary data. Otherwise, the input file should be a text file.
In the obsolescent form, option letters can be concatenated after the number argument to select blocks, bytes, or lines. If this syntax is used, ±number must be the first argument given. If number is not specified, -10 is assumed. This version is provided for backward compatibility only. The forms discussed previously are recommended for portability.
LC_CTYPE determines the locale for the interpretation of sequences of bytes of text data as characters (e.g., single- versus multibyte characters in arguments and input files).
LC_MESSAGES determines the language in which messages are displayed.
If LC_CTYPE or LC_MESSAGES is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG.
If any internationalization variable contains an invalid setting, tail behaves as if all internationalization variables are set to "C". See environ(5).
Print the last three lines in file file1 to the standard output, and leave tail in ``follow'' mode:
tail -fn 3 file1 tail -3 -f file1
Print the last 15 bytes of file logfile followed by any lines that are appended to logfile after tail is initiated until it is killed:
tail -fc15 logfile tail -f -c 15 logfile
Three ways to print an entire file:
tail -b +1 file tail -c +1 file tail -n +1 file
Various kinds of anomalous behavior may occur with character special files. For piped output, tail is limited in its output and depends on process limits.