'\" te .\" Copyright (c) 1992, X/Open Company Limited All Rights Reserved Portions .\" Copyright 1989 AT&T .\" Portions Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. This notice shall appear on any product containing this material. .TH head 1 "21 Jan 2012" "SunOS 5.11" "User Commands" .SH NAME head \- display first few lines of files .SH SYNOPSIS .LP .nf \fB/usr/bin/head\fR [\fB-number\fR | \fB-n\fR \fInumber\fR] [\fIfilename\fR]... .fi .SH DESCRIPTION .sp .LP The \fBhead\fR utility copies the first \fInumber\fR of lines of each \fIfilename\fR to the standard output. If no \fIfilename\fR is given, \fBhead\fR copies lines from the standard input. The default value of \fInumber\fR is \fB10\fR lines. .sp .LP When more than one file is specified, the start of each file looks like: .sp .in +2 .nf \fB==>\fR \fIfilename\fR \fB<==\fR .fi .in -2 .sp .LP Thus, a common way to display a set of short files, identifying each one, is: .sp .in +2 .nf example% \fBhead -9999 filename1 filename2 ...\fR .fi .in -2 .sp .SH OPTIONS .sp .LP The following options are supported: .sp .ne 2 .mk .na \fB\fB-n\fR \fInumber\fR\fR .ad .RS 13n .rt The first \fInumber\fR lines of each input file is copied to standard output. The \fInumber\fR option-argument must be a positive decimal integer. .RE .sp .ne 2 .mk .na \fB\fB-\fR\fInumber\fR\fR .ad .RS 13n .rt The \fInumber\fR argument is a positive decimal integer with the same effect as the \fB-n\fR \fInumber\fR option. .RE .sp .LP If no options are specified, \fBhead\fR acts as if \fB-n\fR \fB10\fR had been specified. .SH OPERANDS .sp .LP The following operand is supported: .sp .ne 2 .mk .na \fB\fB\fIfilename\fR\fR\fR .ad .RS 12n .rt A path name of an input file. If no \fIfile\fR operands are specified, the standard input is used. .RE .SH USAGE .sp .LP See \fBlargefile\fR(5) for the description of the behavior of \fBhead\fR when encountering files greater than or equal to 2 Gbyte (2^31 bytes). .SH EXAMPLES .LP \fBExample 1 \fRWriting the First Ten Lines of All Files .sp .LP The following example writes the first ten lines of all files, except those with a leading period, in the directory: .sp .in +2 .nf example% \fBhead *\fR .fi .in -2 .sp .SH ENVIRONMENT VARIABLES .sp .LP See \fBenviron\fR(5) for descriptions of the following environment variables that affect the execution of \fBhead\fR: \fBLANG\fR, \fBLC_ALL\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR. .SH EXIT STATUS .sp .LP The following exit values are returned: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt Successful completion. .RE .sp .ne 2 .mk .na \fB\fB>0\fR\fR .ad .RS 6n .rt An error occurred. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/core-os _ CSIEnabled _ Interface StabilityCommitted _ StandardSee \fBstandards\fR(5). .TE .SH SEE ALSO .sp .LP \fBcat\fR(1), \fBmore\fR(1), \fBpg\fR(1), \fBtail\fR(1), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)