head [options] [file]Arguments explained
- file is optional; without it, head reads standard input.
- -n chooses the number of lines.
- -c chooses bytes instead of lines.
Common examples
head -n 20 access.logPrints the beginning of a log file.
ps aux | headShows the first few process rows.
| Field | Details |
|---|---|
| Command | head |
| Category | Viewing Content |
| Primary use | Shows the first lines of a file or stream. |
| Syntax | head [options] [file] |