Menu

Display first lines of a text file

The head command displays, by default, the first 10 lines of a text file in Linux. This command is often used to get an idea of the kind of text file you’re looking at; the first 10 lines are usually enough to determine what a file is.

Example:

As with tail, you can specify the number of lines you would like to display with the -n option:

You can display more then one file:

Leave a Reply

Your email address will not be published. Required fields are marked *