TAIL(1) HP-UX 5.0 TAIL(1) NAME tail - deliver the last part of a file SYNOPSIS tail [ _[number][lbc[f] ] ] [ file ] HP-UX COMPATIBILITY Level: HP-UX/STANDARD Origin: System V 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. 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. EXAMPLES Tail accepts at most two arguments: the first consists of specified options, and the second specifies the file of interest. If the number and f options are both desired, they must be concatenated to create a single option argument, as follows: tail -3lf john This example prints the last three lines in the file john to the standard output, and leaves tail in "follow" mode. If only the f option is desired, it must be preceded by a -, as follows: tail -f fred This example prints 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. Note that this output may build up very quickly for rapidly changing input files, perhaps too fast to read on a CRT. As another example, the command: 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. The + option starts at the number indicated from the beginning of the file (rather than skipping the number of units indicated and then starting). For example: tail +1b fred prints the entire contents of the file fred. SEE ALSO head(1). BUGS Tails relative to the end of the file are stored in a buffer, and thus are limited in length. Thus, be wary of the results when piping output from other commands into tail. Various kinds of anomalous behavior may happen with character special files. Tail can pick up a maximum of 4K bytes of data from the specified file.