Annotation of src/usr.bin/head/head.1, Revision 1.16
1.16 ! jmc 1: .\" $OpenBSD: head.1,v 1.15 2009/02/08 17:15:10 jmc Exp $
1.7 aaron 2: .\"
1.1 deraadt 3: .\" Copyright (c) 1980, 1990 The Regents of the University of California.
4: .\" All rights reserved.
5: .\"
6: .\" Redistribution and use in source and binary forms, with or without
7: .\" modification, are permitted provided that the following conditions
8: .\" are met:
9: .\" 1. Redistributions of source code must retain the above copyright
10: .\" notice, this list of conditions and the following disclaimer.
11: .\" 2. Redistributions in binary form must reproduce the above copyright
12: .\" notice, this list of conditions and the following disclaimer in the
13: .\" documentation and/or other materials provided with the distribution.
1.11 millert 14: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 15: .\" may be used to endorse or promote products derived from this software
16: .\" without specific prior written permission.
17: .\"
18: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28: .\" SUCH DAMAGE.
29: .\"
30: .\" from: @(#)head.1 6.6 (Berkeley) 7/24/91
31: .\"
1.16 ! jmc 32: .Dd $Mdocdate: February 8 2009 $
1.1 deraadt 33: .Dt HEAD 1
34: .Os
35: .Sh NAME
36: .Nm head
1.4 aaron 37: .Nd display first few lines of files
1.1 deraadt 38: .Sh SYNOPSIS
39: .Nm head
1.4 aaron 40: .Oo
41: .Fl Ns Ar count No \&|
42: .Fl n Ar count
43: .Oc
1.1 deraadt 44: .Op Ar
45: .Sh DESCRIPTION
1.4 aaron 46: The
47: .Nm
48: utility copies the first
1.1 deraadt 49: .Ar count
1.4 aaron 50: lines of each specified
51: .Ar file
52: to the standard output.
1.5 aaron 53: If no files are named,
1.4 aaron 54: .Nm
55: copies lines from the standard input.
1.1 deraadt 56: If
57: .Ar count
1.4 aaron 58: is omitted, it defaults to 10.
59: .Pp
60: The options are as follows:
61: .Bl -tag -width Ds
62: .It Xo Fl Ns Ar count No \&|
63: .Fl n Ar count
64: .Xc
65: Copy the first
66: .Ar count
67: lines of each input file to the standard output.
68: .Ar count
69: must be a positive decimal integer.
70: .El
71: .Pp
72: If more than one file is specified,
73: .Nm
74: precedes the output of each file with the following, in order to distinguish
75: the head of each file:
76: .Pp
77: .Dl ==> Ar file No <==
1.16 ! jmc 78: .Pp
! 79: .Ex -std head
1.4 aaron 80: .Sh EXAMPLES
81: To display the first 500 lines of the file
82: .Ar foo :
83: .Pp
84: .Dl $ head -500 foo
85: .Pp
86: .Nm
87: can be used in conjunction with
88: .Xr tail 1
89: in the following way to, for example, display only line 500 from the file
90: .Ar foo :
91: .Pp
92: .Dl $ head -500 foo | tail -1
1.1 deraadt 93: .Sh SEE ALSO
1.4 aaron 94: .Xr cat 1 ,
95: .Xr less 1 ,
96: .Xr more 1 ,
1.1 deraadt 97: .Xr tail 1
1.12 jmc 98: .Sh STANDARDS
1.3 aaron 99: The
100: .Nm
1.13 jmc 101: utility is compliant with the
1.15 jmc 102: .St -p1003.1-2008
1.13 jmc 103: specification.
104: .Pp
105: The historic command line syntax is supported by this implementation.
1.1 deraadt 106: .Sh HISTORY
107: The
1.3 aaron 108: .Nm
1.1 deraadt 109: utility appeared in
110: .Bx 3.0 .