What Does Head Do in Linux?

What Does Head Do in Linux?
Contents

The head command, as the name implies, print the top N number of data of the given input. By default, it prints the first 10 lines of the specified files. If more than one file name is provided then data from each file is preceded by its file name.

What does head and tail do in Linux?

They are, by default, installed in all Linux distributions. As their names imply, the head command will output the first part of the file, while the tail command will print the last part of the file. Both commands write the result to standard output.

What does head do in Unix?

head is a program on Unix and Unix-like operating systems used to display the beginning of a text file or piped data.

Sophia Al-Mansoor
Author

Sophia Al-Mansoor

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.