dhcpcd: update README.DRAGONFLY
[dragonfly.git] / usr.bin / tail / tail.1
1 .\" Copyright (c) 1980, 1990, 1991, 1993
2 .\"     The Regents of the University of California.  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 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. Neither the name of the University nor the names of its contributors
16 .\"    may be used to endorse or promote products derived from this software
17 .\"    without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" SUCH DAMAGE.
30 .\"
31 .\"     @(#)tail.1      8.1 (Berkeley) 6/6/93
32 .\" $FreeBSD: src/usr.bin/tail/tail.1,v 1.5.2.4 2002/07/15 07:46:27 keramida Exp $
33 .\"
34 .Dd June 20, 2020
35 .Dt TAIL 1
36 .Os
37 .Sh NAME
38 .Nm tail
39 .Nd display the last part of files
40 .Sh SYNOPSIS
41 .Nm
42 .Oo
43 .Fl F |
44 .Fl f |
45 .Fl r
46 .Oc
47 .Oo
48 .Fl q |
49 .Fl v
50 .Oc
51 .Oo
52 .Fl b Ar number |
53 .Fl c Ar number |
54 .Fl n Ar number
55 .Oc
56 .Op Ar
57 .Sh DESCRIPTION
58 The
59 .Nm
60 utility displays the contents of
61 .Ar file
62 or, by default, its standard input, to the standard output.
63 .Pp
64 The display begins at a byte, line or 512-byte block location in the
65 input.
66 Numbers having a leading plus
67 .Dq ( + )
68 sign are relative to the beginning
69 of the input, for example,
70 .Dq -c +2
71 starts the display at the second
72 byte of the input.
73 Numbers having a leading minus
74 .Dq ( - )
75 sign or no explicit sign are
76 relative to the end of the input, for example,
77 .Dq -n 2
78 displays the last two lines of the input.
79 The default starting location is
80 .Dq -n 10 ,
81 or the last 10 lines of the input.
82 .Pp
83 The options are as follows:
84 .Bl -tag -width Ds
85 .It Fl b Ar number
86 The location is
87 .Ar number
88 512-byte blocks.
89 .It Fl c Ar number
90 The location is
91 .Ar number
92 bytes.
93 .It Fl f
94 The
95 .Fl f
96 option causes
97 .Nm
98 to not stop when end of file is reached, but rather to wait for additional
99 data to be appended to the input.
100 The
101 .Fl f
102 option is ignored if the standard input is a pipe, but not if it is a FIFO.
103 .It Fl F
104 The
105 .Fl F
106 option implies the
107 .Fl f
108 option, but
109 .Nm
110 will also check to see if the file being followed has been renamed or rotated.
111 The file is closed and reopened when
112 .Nm
113 detects that the filename being read from has a new inode number.
114 The
115 .Fl F
116 option is ignored if reading from standard input rather than a file.
117 .It Fl n Ar number
118 The location is
119 .Ar number
120 lines.
121 .It Fl q
122 Suppresses printing of headers when multiple files are being examined.
123 .It Fl r
124 The
125 .Fl r
126 option causes the input to be displayed in reverse order, by line.
127 Additionally, this option changes the meaning of the
128 .Fl b ,
129 .Fl c
130 and
131 .Fl n
132 options.
133 When the
134 .Fl r
135 option is specified, these options specify the number of bytes, lines
136 or 512-byte blocks to display, instead of the bytes, lines or blocks
137 from the beginning or end of the input from which to begin the display.
138 The default for the
139 .Fl r
140 option is to display all of the input.
141 .It Fl v
142 Always prints a header for each file, even if only a single file is
143 specified.
144 .El
145 .Pp
146 If more than a single file is specified, or the
147 .Fl v
148 flag is used, each file is preceded by a header consisting of the string
149 .Dq ==> XXX <==
150 where
151 .Dq XXX
152 is the name of the file.
153 The
154 .Fl q
155 flag disables the printing of the header in both cases.
156 .Sh EXIT STATUS
157 .Ex -std
158 .Sh SEE ALSO
159 .Xr cat 1 ,
160 .Xr head 1 ,
161 .Xr sed 1 ,
162 .Xr tac 1
163 .Sh STANDARDS
164 The
165 .Nm
166 utility is expected to be a superset of the
167 .St -p1003.2-92
168 specification.
169 In particular, the
170 .Fl F ,
171 .Fl b
172 and
173 .Fl r
174 options are extensions to that standard.
175 .Pp
176 The historic command line syntax of
177 .Nm
178 is supported by this implementation.
179 The only difference between this implementation and historic versions
180 of
181 .Nm ,
182 once the command line syntax translation has been done, is that the
183 .Fl b ,
184 .Fl c
185 and
186 .Fl n
187 options modify the
188 .Fl r
189 option, i.e.
190 .Dq -r -c 4
191 displays the last 4 characters of the last line
192 of the input, while the historic tail (using the historic syntax
193 .Dq -4cr )
194 would ignore the
195 .Fl c
196 option and display the last 4 lines of the input.
197 .Sh HISTORY
198 A
199 .Nm
200 command appeared in PWB
201 .Ux .