Head

The head tool is a Linux command line tool that, as the name implies, outputs the top N number of lines of given input text. By default head will output the first 10 lines of the specified file or provided text. If more than 10 lines are desired a number can be specified with the -n flag. head is also the counterpart to Tail.

For example:

head /etc/passwd

Will give us the first 10 lines of /etc/passwd:

This page was last updated: 2025-02-20 Thu 02:46. Source