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