1*ab046ee6SThomas Cort.\" $NetBSD: head.1,v 1.12 2004/05/04 23:44:21 wiz Exp $ 2*ab046ee6SThomas Cort.\" 3*ab046ee6SThomas Cort.\" Copyright (c) 1980, 1990, 1993 4*ab046ee6SThomas Cort.\" The Regents of the University of California. All rights reserved. 5*ab046ee6SThomas Cort.\" 6*ab046ee6SThomas Cort.\" Redistribution and use in source and binary forms, with or without 7*ab046ee6SThomas Cort.\" modification, are permitted provided that the following conditions 8*ab046ee6SThomas Cort.\" are met: 9*ab046ee6SThomas Cort.\" 1. Redistributions of source code must retain the above copyright 10*ab046ee6SThomas Cort.\" notice, this list of conditions and the following disclaimer. 11*ab046ee6SThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright 12*ab046ee6SThomas Cort.\" notice, this list of conditions and the following disclaimer in the 13*ab046ee6SThomas Cort.\" documentation and/or other materials provided with the distribution. 14*ab046ee6SThomas Cort.\" 3. Neither the name of the University nor the names of its contributors 15*ab046ee6SThomas Cort.\" may be used to endorse or promote products derived from this software 16*ab046ee6SThomas Cort.\" without specific prior written permission. 17*ab046ee6SThomas Cort.\" 18*ab046ee6SThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19*ab046ee6SThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20*ab046ee6SThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21*ab046ee6SThomas Cort.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22*ab046ee6SThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23*ab046ee6SThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24*ab046ee6SThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25*ab046ee6SThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26*ab046ee6SThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27*ab046ee6SThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28*ab046ee6SThomas Cort.\" SUCH DAMAGE. 29*ab046ee6SThomas Cort.\" 30*ab046ee6SThomas Cort.\" from: @(#)head.1 8.1 (Berkeley) 6/6/93 31*ab046ee6SThomas Cort.\" 32*ab046ee6SThomas Cort.Dd May 4, 2004 33*ab046ee6SThomas Cort.Dt HEAD 1 34*ab046ee6SThomas Cort.Os 35*ab046ee6SThomas Cort.Sh NAME 36*ab046ee6SThomas Cort.Nm head 37*ab046ee6SThomas Cort.Nd display first lines of a file 38*ab046ee6SThomas Cort.Sh SYNOPSIS 39*ab046ee6SThomas Cort.Nm 40*ab046ee6SThomas Cort.Op Fl qv 41*ab046ee6SThomas Cort.Op Fl n Ar count 42*ab046ee6SThomas Cort.Op Fl c Ar byte_count 43*ab046ee6SThomas Cort.Op Ar file ... 44*ab046ee6SThomas Cort.Sh DESCRIPTION 45*ab046ee6SThomas CortThis filter displays the first 46*ab046ee6SThomas Cort.Ar count 47*ab046ee6SThomas Cortlines of each of the specified files, or of the standard input if no 48*ab046ee6SThomas Cortfiles are specified. 49*ab046ee6SThomas CortIf 50*ab046ee6SThomas Cort.Ar count 51*ab046ee6SThomas Cortis omitted it defaults to 10. 52*ab046ee6SThomas CortIf 53*ab046ee6SThomas Cort.Fl c Ar byte_count 54*ab046ee6SThomas Cortis specified, 55*ab046ee6SThomas Cort.Nm 56*ab046ee6SThomas Cortcounts bytes instead of lines. 57*ab046ee6SThomas Cort.Pp 58*ab046ee6SThomas CortIf more than a single file is specified, or the 59*ab046ee6SThomas Cort.Fl v 60*ab046ee6SThomas Cortoption is used, each file is preceded by a header consisting of the string 61*ab046ee6SThomas Cort.Dq ==\*[Gt] XXX \*[Le]= 62*ab046ee6SThomas Cortwhere 63*ab046ee6SThomas Cort.Dq XXX 64*ab046ee6SThomas Cortis the name of the file. 65*ab046ee6SThomas CortThe 66*ab046ee6SThomas Cort.Fl q 67*ab046ee6SThomas Cortflag disables the printing of the header in all cases. 68*ab046ee6SThomas Cort.Pp 69*ab046ee6SThomas CortThe 70*ab046ee6SThomas Cort.Nm 71*ab046ee6SThomas Cortutility exits 0 on success, and \*[Gt]0 if an error occurs. 72*ab046ee6SThomas Cort.Sh COMPATIBILITY 73*ab046ee6SThomas CortThe historic command line syntax of 74*ab046ee6SThomas Cort.Nm 75*ab046ee6SThomas Cortis supported by this implementation. 76*ab046ee6SThomas Cort.Pp 77*ab046ee6SThomas CortThis command is mostly compatible with GNU extensions to 78*ab046ee6SThomas Cort.Nm . 79*ab046ee6SThomas Cort.Sh SEE ALSO 80*ab046ee6SThomas Cort.Xr tail 1 81*ab046ee6SThomas Cort.Sh STANDARDS 82*ab046ee6SThomas CortThe 83*ab046ee6SThomas Cort.Nm 84*ab046ee6SThomas Cortutility conforms to 85*ab046ee6SThomas Cort.St -p1003.2-92 . 86*ab046ee6SThomas Cort.Sh HISTORY 87*ab046ee6SThomas CortThe 88*ab046ee6SThomas Cort.Nm 89*ab046ee6SThomas Cortutility appeared in 90*ab046ee6SThomas Cort.Bx 3.0 . 91*ab046ee6SThomas CortIt was enhanced to include the 92*ab046ee6SThomas Cort.Fl c , 93*ab046ee6SThomas Cort.Fl q , 94*ab046ee6SThomas Cortand 95*ab046ee6SThomas Cort.Fl v 96*ab046ee6SThomas Cortoptions for 97*ab046ee6SThomas Cort.Nx 2.1 . 98