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

1.4     ! aaron       1: .\"    $OpenBSD: head.1,v 1.3 1999/06/05 01:21:27 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.
        !            56: If no
        !            57: .Ar file
        !            58: is given,
        !            59: .Nm
        !            60: copies lines from the standard input.
1.1       deraadt    61: If
                     62: .Ar count
1.4     ! aaron      63: is omitted, it defaults to 10.
        !            64: .Pp
        !            65: The options are as follows:
        !            66: .Pp
        !            67: .Bl -tag -width Ds
        !            68: .It Xo Fl Ns Ar count No \&|
        !            69: .Fl n Ar count
        !            70: .Xc
        !            71: Copy the first
        !            72: .Ar count
        !            73: lines of each input file to the standard output.
        !            74: .Ar count
        !            75: must be a positive decimal integer.
        !            76: .El
        !            77: .Pp
        !            78: If more than one file is specified,
        !            79: .Nm
        !            80: precedes the output of each file with the following, in order to distinguish
        !            81: the head of each file:
        !            82: .Pp
        !            83: .Dl ==> Ar file No <==
        !            84: .Sh EXAMPLES
        !            85: To display the first 500 lines of the file
        !            86: .Ar foo :
        !            87: .Pp
        !            88: .Dl $ head -500 foo
        !            89: .Pp
        !            90: .Nm
        !            91: can be used in conjunction with
        !            92: .Xr tail 1
        !            93: in the following way to, for example, display only line 500 from the file
        !            94: .Ar foo :
        !            95: .Pp
        !            96: .Dl $ head -500 foo | tail -1
1.1       deraadt    97: .Sh COMPATIBILITY
1.3       aaron      98: The historic command line syntax of
                     99: .Nm
1.1       deraadt   100: is supported by this implementation.
                    101: .Sh SEE ALSO
1.4     ! aaron     102: .Xr cat 1 ,
        !           103: .Xr less 1 ,
        !           104: .Xr more 1 ,
1.1       deraadt   105: .Xr tail 1
                    106: .Sh STANDARDS
1.3       aaron     107: The
                    108: .Nm
1.1       deraadt   109: utility conforms to
                    110: .St -p1003.2-92 .
                    111: .Sh HISTORY
                    112: The
1.3       aaron     113: .Nm
1.1       deraadt   114: utility appeared in
                    115: .Bx 3.0 .