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 first NUM bytes of each file. And if you put a leading - on that NUM? Iconic behaviour: it prints all but the last NUM bytes of each file. πŸŽ€
  • -n, --lines <[-]NUM> β€” print the first NUM lines instead of the default first 10. With a leading -, it prints all but the last NUM lines 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