head
Display the first lines of a file. Default shows first 10 lines, -n specifies number of lines.
Primary Syntax
$ head -n 20 file.txt
#
Example Usage
head -n 5 /etc/passwd
head -c 100 file.txt#
Quick Tips
• Use man head to read the full manual
• Add --help flag for quick options reference
• Combine with | less for paginated output
Submitted by: admin
Added: 2/9/2026