What is the purpose of the head command?

The head command in Linux is used to display the beginning of a file. By default, it shows the first 10 lines of the specified file. You can also specify the number of lines to display using the -n option.

Example:

To display the first 5 lines of a file named example.txt, you would use:

head -n 5 example.txt

This command is useful for quickly viewing the start of a file without opening the entire file.

0 Comments

no data
Be the first to share your comment!