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 isNUL, 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= 512kB= 1000K= 1024MB= 1000*1000M= 1024*1024GB= 1000*1000*1000G= 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:
- Report bugs to: <bug-coreutils@gnu.org>.
- Report any translation bugs to: <https://translationproject.org/team/>.
- GNU coreutils home page: <https://www.gnu.org/software/coreutils/>
- General help using GNU software: <https://www.gnu.org/gethelp/>
๐ COPYRIGHT ๐
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
- arch rolling: coreutils 9.12-2 ยท GPL-3.0-or-later AND GFDL-1.3-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms