HEAD(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ’– HEAD(1) πŸ’–

okay bestie, welcome to head β€” the Little Sister of the command line, from the GNU coreutils family, living in User Commands. she's giving main character energy and honestly? she deserves it. πŸŽ€


✨ NAME ✨

head β€” output the first part of files. that's it. that's the whole vibe. she peeks at the top of your file and shows you what's up. πŸ’…


✨ SYNOPSIS ✨

head [OPTION]... [FILE]...

✨ DESCRIPTION ✨

so here's the tea: head prints the first 10 lines of each FILE to standard output. ten. that's the default. no notes. ✨

if you hand her more than one FILE, she's polite about it β€” she'll precede each one with a header that tells you which file you're looking at. because otherwise you'd be lost and confused and we don't do that here. 🫢

if you give her no FILE, or FILE is literally just -, she reads from standard input. slay, she's flexible. 😌

okay important one, don't skip this: Mandatory arguments to long options are mandatory for short options too. the long-option girlies and the short-option girlies play by the same rules. periodt. πŸ’€

okay now the ✨options✨, sit down, get comfy:

  • -c, --bytes=[-]NUM β€” print the first NUM bytes of each file. but if that NUM has a leading - in front of it? plot twist: she prints all but the last NUM bytes. iconic behaviour, truly. πŸ’–
  • -n, --lines=[-]NUM β€” print the first NUM lines instead of the first 10. and yeah, same little trick: with a leading -, she prints all but the last NUM lines of each file. she contains multitudes. πŸ¦‹
  • -q, --quiet, --silent β€” never print headers giving file names. she goes quiet, she minds her business, she's mysterious. πŸ™ˆ
  • -v, --verbose β€” always print headers giving file names. the opposite energy. she's telling you EVERYTHING and honestly good for her. πŸ‘‘
  • -z, --zero-terminated β€” the line delimiter is NUL, not newline. for when your data is built different. ⭐
  • --help β€” display this help and exit. she'll explain herself, love that for her.
  • --version β€” output version information and exit. she'll tell you who she is. πŸŽ€

🌸 about that NUM, bestie 🌸

lowkey important, highkey useful: NUM may have a multiplier suffix. here's the full list, keep it in your notes app:

  • b = 512
  • kB = 1000
  • K = 1024
  • MB = 1000*1000
  • M = 1024*1024
  • GB = 1000*1000*1000
  • G = 1024*1024*1024
  • and so on for T, P, E, Z, Y, R, Q

and yes, binary prefixes work too: KiB=K, MiB=M, and so on. so if you've ever been like "is it 1000 or is it 1024" β€” it's both, it depends on the letter, and now you know. iykyk. πŸ’œ


✨ AUTHOR ✨

Written by David MacKenzie and Jim Meyering. absolute legends, we stan. πŸ’–


✨ REPORTING BUGS ✨

found a bug? don't suffer in silence, tell the girlies:


✨ SEE ALSO ✨

  • tail(1) β€” her sister. opposite direction. equally iconic. 🌈

full documentation lives at https://www.gnu.org/software/coreutils/head, or you can get it locally via:

info '(coreutils) head invocation'

Packaged by Ubuntu (9.10-1ubuntu2) Copyright Β© 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


okay that's the whole page bestie, you ate that πŸ“ this was GNU coreutils 9.10, dated August 2026, and that's the tea β€” mwah, go read the top 10 lines of something. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from