How do I use the -n option?

To use the -n option with the head command, you specify the number of lines you want to display from the beginning of a file. The syntax is as follows:

head -n NUM filename

Where NUM is the number of lines you want to see, and filename is the name of the file.

Example:

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

head -n 5 example.txt

This command will output the first 5 lines of example.txt to the terminal.

0 Comments

no data
Be the first to share your comment!