Compared to cat, which reads the entire content of a file, head by default only reads the first 10 lines of a text file.
The syntax of the head command is as follows:
head [OPTIONS] [FILE] .
Some common options for the head command include:
$ head FILE ←Reads the first 10 lines of the file "FILE." $ head -n 50 FILE1 > FILE2 ←Saves the first 50 lines of "FILE1" as a new file named "FILE2." $ ls --help | head ←Displays only the first 10 lines of the online manual for the "ls" command. |