🧀 Learn Linux

Commonly used · Reading and processing text

head: Read the first few lines

Put in free practice

Syntax

head [-n lines] [file…]

Options

-n
Specify the number of rows (default 10)

Examples

head -n 2 logs/app.log

Usage and sandbox support

Takeable channels for quick preview.

Hands-on exercises

Full documentation ↗

Related commands