Head

From LQWiki
Jump to navigation Jump to search

Head is a command for viewing the first few lines of a file, or of some output of another program. If you run a command that gives many lines of output, but you're only interested in the very top, then head is exactly what you're looking for.

Usage

head [option] file

Examples

ls -lt | head

This has head reading from stdin and showing the 10 newest entries in a directory.

Provided by

Most (all?) Linux distributions incorporate this from the GNU Coreutils: and use its man page

See also