[BACK]Return to head.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / head

Annotation of src/usr.bin/head/head.1, Revision 1.6

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