Display the first part of a file with head


Similar to the tail command which shows you the last few lines of a text file, the head command lets you to quickly view the first few lines.

The head command syntax.

By default head will show you the first 10 lines of a text file.

You can change the number of lines displayed by adding ‘-n‘ option and adding the number of lines.

This will show the first 3 lines in the file.