www.delorie.com/gnu/docs/textutils/coreutils_18.html   search  
 
Buy GNU books!


GNU Core-utils

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1 head: Output the first part of files

head prints the first part (10 lines by default) of each file; it reads from standard input if no files are given or when given a file of `-'. Synopsis:

 
head [option]... [file]...

If more than one file is specified, head prints a one-line header consisting of
 
==> file name <==
before the output for each file.

The program accepts the following options. Also see 2. Common options.

`-c bytes'
`--bytes=bytes'
Print the first bytes bytes, instead of initial lines. Appending `b' multiplies bytes by 512, `k' by 1024, and `m' by 1048576.

`-n n'
`--lines=n'
Output the first n lines.

`-q'
`--quiet'
`--silent'
Never print file name headers.

`-v'
`--verbose'
Always print file name headers.

On older systems, head supports an obsolete option `-countoptions', which is recognized only if it is specified first. count is a decimal number optionally followed by a size letter (`b', `k', `m') as in -c, or `l' to mean count by lines, or other option letters (`cqv'). POSIX 1003.1-2001 (see section 2.5 Standards conformance) does not allow this; use `-c count' or `-n count' instead.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003