Commands.app

head

Text Processing

Display the first lines of a file

Options & Flags
Available options for this command
-n NUM

Print first NUM lines (default 10)

-c NUM

Print first NUM bytes

Examples
Common usage examples

Display first 10 lines

head file.txt

Display first 20 lines

head -n 20 file.txt

Display all except last 5 lines

head -n -5 file.txt
Related Commands
You might also find these useful