$ head
Output the beginning of files
DOCUMENTEDViewing filesUbuntu 24.04 LTS baseline
Synopsis
head [OPTION]... [FILE]...
What it does
- The default output is the first 10 lines of each file.
- `-n` selects the number of lines to output.
Examples
Show first 10 lines
head file.txtShow first 20 lines
head -n 20 file.txtImportant details
These examples are intentionally conservative. Command behavior can still depend on filesystem state, permissions, locale, shell, installed package version, and other system configuration.
For exact option semantics, the linked authoritative documentation is the source of truth.