HEAD(1)

๐Ÿ’– NAME ๐Ÿ’–

head โ€” output the first part of files, bestie. that's it, that's the whole job. it's head(1), from the User Commands manual, and it is so useful you're gonna be obsessed. โœจ


๐ŸŒธ SYNOPSIS ๐ŸŒธ

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

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so here's the tea: head prints the first 10 lines of each FILE straight to standard output. that's the default, no cap. ๐Ÿซถ

if you hand it more than one FILE, it slaps a header before each one so you know which file's which. very considerate of it, honestly. ๐Ÿ‘‘

if you give it no FILE at all, or you pass FILE as -, it reads from standard input instead. classic.

heads up bestie: mandatory arguments to long options are mandatory for short options too. that means if the long one needs a value, the short one does too. no shortcuts around it. ๐Ÿ’…

โœจ OPTIONS โœจ

  • -c, --bytes=[-]NUM โ€” prints the first NUM bytes of each file. but if NUM has a leading -, it flips the whole vibe and prints all but the last NUM bytes of each file. not me giving you two tools in one flag ๐Ÿ˜ญ
  • -n, --lines=[-]NUM โ€” prints the first NUM lines instead of the default first 10. and again, leading -? it prints all but the last NUM lines of each file. iconic behaviour honestly.
  • -q, --quiet, --silent โ€” never print headers giving file names. shhh. ๐Ÿคซ
  • -v, --verbose โ€” always print headers giving file names. loud and proud, main character energy. ๐Ÿ“ฃ
  • -z, --zero-terminated โ€” the line delimiter is NUL, not newline. for when your data is built different. ๐Ÿงš
  • --help โ€” display this help and exit. your little pocket bestie. ๐ŸŽ€
  • --version โ€” output version information and exit. ๐ŸŒˆ

NUM may have a multiplier suffix, and here's the full list because we do not gatekeep:

  • 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. ๐Ÿ”ฅ

binary prefixes can be used too: KiB=K, MiB=M, and so on. so fancy. โœจ


๐Ÿ’œ AUTHOR ๐Ÿ’œ

Written by David MacKenzie and Jim Meyering. legends, fr fr. ๐Ÿซถ


๐Ÿ™ˆ REPORTING BUGS ๐Ÿ™ˆ

found a bug? don't just scream about it in the group chat, tell the people who can actually fix it:


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. like, zero. none. don't come for them. ๐Ÿ’€


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • tail(1) โ€” the other half of the duo, iykyk ๐Ÿฆ‹

Full documentation <https://www.gnu.org/software/coreutils/head> โ€” or available locally via: info '(coreutils) head invocation'


k bye bestie, go print some lines ๐Ÿ’…โœจ this was GNU coreutils 9.12, from September 2026, and yes it really is HEAD(1) โ€” slay, periodt. ๐ŸŽ€๐Ÿซถ

๐Ÿ“ฆ where this page comes from