Commit | Line | Data |
---|---|---|
19dad70e CL |
1 | .\" Copyright (c) 1980, 1990, 1991 Regents of the University of California. |
2 | .\" All rights reserved. | |
09d34764 | 3 | .\" |
ae122740 KB |
4 | .\" This code is derived from software contributed to Berkeley by |
5 | .\" the Institute of Electrical and Electronics Engineers, Inc. | |
6 | .\" | |
19dad70e | 7 | .\" %sccs.include.redist.roff% |
09d34764 | 8 | .\" |
0da48e03 | 9 | .\" @(#)tail.1 6.7 (Berkeley) %G% |
19dad70e CL |
10 | .\" |
11 | .Dd | |
12 | .Dt TAIL 1 | |
13 | .Os BSD 4 | |
14 | .Sh NAME | |
15 | .Nm tail | |
0da48e03 | 16 | .Nd display the last part of a file |
19dad70e CL |
17 | .Sh SYNOPSIS |
18 | .Nm tail | |
0da48e03 KB |
19 | .Op Fl f Li | Fl r |
20 | .Oo | |
21 | .Fl b Ar number | | |
22 | .Fl c Ar number | | |
23 | .Fl n Ar number | |
19dad70e CL |
24 | .Oc |
25 | .Op Ar file | |
26 | .Sh DESCRIPTION | |
27 | The | |
28 | .Nm tail | |
0da48e03 KB |
29 | utility displays the contents of |
30 | .Ar file | |
31 | or, by default, its standard input, to the standard output. | |
32 | .Pp | |
33 | The display begins at an offset from either the beginning or end | |
34 | of the input. | |
35 | Offsets may be specified in terms of bytes, lines or 512-byte blocks. | |
36 | Numbers having a leading plus (``+'') sign are relative to the beginning | |
37 | of the input. | |
38 | Numbers having a leading minus (``-'') sign or no explicit sign are | |
39 | relative to the end of the input. | |
40 | All offsets are 1 based, i.e. ``-c +1'' skips a single byte of the | |
41 | input. | |
42 | The default offset is ``-n 10'', or 10 lines from the end of the | |
19dad70e CL |
43 | input. |
44 | .Pp | |
0da48e03 | 45 | The options are as follows: |
19dad70e | 46 | .Bl -tag -width Ds |
0da48e03 KB |
47 | .It Fl b Ar number |
48 | The offset is | |
19dad70e | 49 | .Ar number |
0da48e03 KB |
50 | 512-byte blocks. |
51 | .It Fl c Ar number | |
52 | The offset is | |
19dad70e | 53 | .Ar number |
0da48e03 KB |
54 | bytes. |
55 | .It Fl f | |
56 | The | |
57 | .Fl f | |
58 | option causes | |
19dad70e | 59 | .Nm tail |
0da48e03 KB |
60 | to not stop when end of file is reached, but rather to wait for additional |
61 | data to be appended to the input. | |
62 | The | |
63 | .Fl f | |
64 | option is ignored on pipes but not on FIFO's. | |
65 | .It Fl n Ar number | |
66 | The offset is | |
19dad70e | 67 | .Ar number |
0da48e03 KB |
68 | lines. |
69 | .It Fl r | |
70 | The | |
71 | .Fl r | |
72 | option causes the input to be displayed in reverse order, by line. | |
73 | Additionally, this option changes the meaning of the | |
74 | .Fl b , | |
75 | .Fl c | |
76 | and | |
77 | .Fl n | |
78 | options. | |
79 | When the | |
80 | .Fl r | |
81 | option is specified, these options specify the number of bytes, lines | |
82 | or 512-byte blocks to display, instead of the bytes, lines or blocks | |
83 | from the beginning or end of the input from which to begin the display. | |
84 | The default for the | |
85 | .Fl r | |
86 | option is to display all of the input. | |
19dad70e CL |
87 | .El |
88 | .Pp | |
89 | The | |
90 | .Nm tail | |
91 | utility exits 0 on success, and >0 if an error occurs. | |
92 | .Sh SEE ALSO | |
0da48e03 KB |
93 | .Xr cat 1 , |
94 | .Xr head 1 , | |
95 | .Xr sed 1 | |
96 | .Sh STANDARDS | |
97 | The | |
19dad70e | 98 | .Nm tail |
0da48e03 KB |
99 | utility is expected to be a superset of the POSIX 1003.2 |
100 | specification. | |
101 | In particular, the | |
102 | .Fl r | |
103 | option is an extension to that standard. | |
19dad70e CL |
104 | .Sh HISTORY |
105 | A | |
0da48e03 | 106 | .Nm tail |
19dad70e CL |
107 | command appeared in |
108 | .At v7 . |