HEAD(1)
π NAME π
head β bestie, this is the little icon that peeks at the first 10 lines of every FILE and prints them straight to standard output. π
Okay so more of it: if you hand it more than one FILE, it slaps a header in front of each one telling you which file you're looking at. And if you give it no FILE at all, or if FILE is literally just -, it reads from standard input. β¨
Oh and also, real talk: mandatory arguments to long options are mandatory for short options too. That's not me being dramatic, that's the rules. π«Ά
πΈ SYNOPSIS πΈ
head [OPTION]... [FILE]...
π¦ DESCRIPTION π¦
Print the first 10 lines of each FILE to standard output. Yep, that's the whole gig and it eats every time. β¨
With more than one FILE, it puts a header before each chunk so you know which file is which. With no FILE, or when FILE is -, it reads from standard input. Slay.
And one more time for the people in the back: mandatory arguments to long options are mandatory for short options too. π
β¨ OPTIONS β¨
-c,--bytes <[-]NUM>β print the firstNUMbytes of each file. And if you put a leading-on that NUM? Iconic behaviour: it prints all but the lastNUMbytes of each file. π-n,--lines <[-]NUM>β print the firstNUMlines instead of the default first 10. With a leading-, it prints all but the lastNUMlines of each file. Obsessed. π-q,--quietβ never print headers giving file names. Shy girl energy, no labels. π-v,--verboseβ always print headers giving file names, even when you didn't ask. Main character announcement energy. π-z,--zero-terminatedβ line delimiter is NUL, not newline. For the byte-gremlin girlies. π-h,--helpβ Print help. Your safe word. π«Ά-V,--versionβ Print version. π[FILE] [default: -]β the files you wanna peek at, and yeah, the default is literally-which means standard input. β
π§ VERSION π§
v(uutils coreutils) 0.12.0
π₯ EXAMPLES π₯
Output the first few lines of a file:
head -n count path/to/file
Heads up bestie: the examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail. Not a vibe, but we move. π
okay bye ily, go read some files π
β¨π β this was the head(1) page from the General Commands Manual, dated 2026-09-25. periodt. π¦πΈπ
π¦ where this page comes from
- ubuntu stonking: rust-coreutils 0.12.0-1ubuntu2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms