xref: /original-bsd/usr.bin/tail/tail.1 (revision ba762ddc)
1.\" Copyright (c) 1980, 1990, 1991 Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\"		@(#)tail.1	6.5 (Berkeley) 04/22/91
5.\" %sccs.include.redist.roff%
6.\"
7.\"     @(#)tail.1	6.5 (Berkeley) 04/22/91
8.\"
9.Dd
10.Dt TAIL 1
11.Os BSD 4
12.Sh NAME
13.Nm tail
14.Nd deliver the last part of a file
15.Sh SYNOPSIS
16.Nm tail
17.Oo Cm \\*(Pm Ns Ar number
18.Op Ns Cm lbc Op Ns Cm fr
19.Oc
20.Op Ar file
21.Sh DESCRIPTION
22The
23.Nm tail
24utility copies its input file to the standard output
25beginning at a designated place.
26The argument
27.Ar number
28is counted in
29units of blocks, characters or lines (default),
30according to the appended option suffixes
31.Cm b , c
32and
33.Cm l .
34Copying begins at the point in the file indicated by the
35.Cm \\*(Pm Ns Ar number
36option, where
37.Cm + Ns Ar number
38is a positive offset relative to the beginning of the file
39and
40.Cm \&- Ns Ar number
41is a negative offset relative to the end of the file or standard
42input.
43.Pp
44Appended options:
45.Bl -tag -width Ds
46.It Cm b
47The argument
48.Ar number
49refers to blocks.
50.It Cm c
51The argument
52.Ar number
53refers to characters (bytes).
54.It Cm f
55Specifying
56.Cm f
57causes
58.Nm tail
59to not quit at end of file, but rather wait and try to read repeatedly
60in hopes that the file will grow.
61.It Cm l
62The argument
63.Ar number
64refers to line.
65.It Cm r
66Lines are printed from
67.Ar file
68in reverse order.
69The default for
70.Ar r
71is to print the entire file this way.
72.El
73.Pp
74The
75.Nm tail
76utility exits 0 on success, and >0 if an error occurs.
77.Sh SEE ALSO
78.Xr dd 1
79.Sh BUGS
80The behaviour of
81.Nm tail
82on binary or special files is unpredictable.
83.Sh HISTORY
84A
85.Nm
86command appeared in
87.At v7 .
88