xref: /minix3/usr.bin/head/head.1 (revision ab046ee6ea7b9179bf5fd3632f2be4376e45c108)
1.\"	$NetBSD: head.1,v 1.12 2004/05/04 23:44:21 wiz Exp $
2.\"
3.\" Copyright (c) 1980, 1990, 1993
4.\"	The Regents of the University of California.  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.
14.\" 3. Neither the name of the University nor the names of its contributors
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	8.1 (Berkeley) 6/6/93
31.\"
32.Dd May 4, 2004
33.Dt HEAD 1
34.Os
35.Sh NAME
36.Nm head
37.Nd display first lines of a file
38.Sh SYNOPSIS
39.Nm
40.Op Fl qv
41.Op Fl n Ar count
42.Op Fl c Ar byte_count
43.Op Ar file ...
44.Sh DESCRIPTION
45This filter displays the first
46.Ar count
47lines of each of the specified files, or of the standard input if no
48files are specified.
49If
50.Ar count
51is omitted it defaults to 10.
52If
53.Fl c Ar byte_count
54is specified,
55.Nm
56counts bytes instead of lines.
57.Pp
58If more than a single file is specified, or the
59.Fl v
60option is used, each file is preceded by a header consisting of the string
61.Dq ==\*[Gt] XXX \*[Le]=
62where
63.Dq XXX
64is the name of the file.
65The
66.Fl q
67flag disables the printing of the header in all cases.
68.Pp
69The
70.Nm
71utility exits 0 on success, and \*[Gt]0 if an error occurs.
72.Sh COMPATIBILITY
73The historic command line syntax of
74.Nm
75is supported by this implementation.
76.Pp
77This command is mostly compatible with GNU extensions to
78.Nm .
79.Sh SEE ALSO
80.Xr tail 1
81.Sh STANDARDS
82The
83.Nm
84utility conforms to
85.St -p1003.2-92 .
86.Sh HISTORY
87The
88.Nm
89utility appeared in
90.Bx 3.0 .
91It was enhanced to include the
92.Fl c ,
93.Fl q ,
94and
95.Fl v
96options for
97.Nx 2.1 .
98