[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.10

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