LOOK(1)

๐Ÿ‘‘ LOOK(1) โ€” the look girlie's manual ๐Ÿ’…

okay so bestie, welcome to look โ€” the User Commands era of the manual, and honestly? she's iconic. this is the page for the look utility and it's gonna change your grep-adjacent life, no cap.


โœจ NAME โœจ

look โ€” display lines beginning with a given string ๐Ÿฆ‹


โœจ SYNOPSIS โœจ

look [options] string [file]

โœจ DESCRIPTION โœจ

so the look utility does the thing: it displays any lines in file which contain string as a prefix. that's it, that's the vibe. ๐Ÿ’–

BUT โ€” and this is the part where you gotta listen, bestie โ€” look performs a binary search. which means the lines in file must be sorted. and not just "sorted-ish", like actually sorted, where sort(1) was given the same options -d and/or -f that look is invoked with. match those up or she will simply not find your lines and you'll be sad. ๐Ÿ˜ญ

if file is not specified? no worries, she defaults to /usr/share/dict/words. and in that case, only alphanumeric characters are compared, and the case of alphabetic characters is ignored. lowkey convenient, highkey iconic. โœจ


๐ŸŒธ OPTIONS ๐ŸŒธ

  • -a, --alternative โ€” use the alternative dictionary file. the other dictionary. the alt girl of dictionaries. ๐Ÿ’œ
  • -d, --alphanum โ€” use normal dictionary character set and order, i.e., only blanks and alphanumeric characters are compared. this is on by default if no file is specified. ๐ŸŽ€
note that blanks have been added to the dictionary character set for compatibility with the sort -d command since version 2.28. yes, blanks. the space bar got an invite. ๐Ÿซถ
  • -f, --ignore-case โ€” ignore the case of alphabetic characters. also on by default if no file is specified. she does not care about your capital letters, periodt. ๐Ÿ‘‘
  • -t, --terminate character โ€” specify a string termination character, i.e., only the characters in string up to and including the first occurrence of character are compared. so you can say "okay compare this much and then stop, bestie". ๐Ÿ›‘
  • -h, --help โ€” display help text and exit. the classic. ๐ŸŒˆ
  • -V, --version โ€” display version and exit. she'll tell you who she is. โญ

๐Ÿ’€ EXIT STATUS ๐Ÿ’€

the look utility exits 0 if one or more lines were found and displayed, 1 if no lines were found, and >1 if an error occurred. so 1 is just "nothing matched, not a crisis", and >1 is "something actually went wrong". iykyk. ๐Ÿ™ˆ


๐Ÿงš ENVIRONMENT ๐Ÿงš

  • WORDLIST โ€” path to a dictionary file. this environment variable has greater priority than the dictionary path defined in the FILES segment. so if you set it, she listens to you first. main character energy fr fr. ๐Ÿ’…

๐Ÿ“ FILES ๐Ÿ“

  • /usr/share/dict/words โ€” the dictionary. the default one. the blueprint. ๐Ÿ’–
  • /usr/share/dict/web2 โ€” the alternative dictionary. ๐ŸŒธ

๐Ÿฆ‹ HISTORY ๐Ÿฆ‹

the look utility appeared in Version 7 AT&T Unix. she's old, she's vintage, she's still slaying. ๐Ÿ‘‘


๐Ÿ”ฅ EXAMPLES ๐Ÿ”ฅ

sort -d /etc/passwd -o /tmp/look.dict
look -t: root:foobar /tmp/look.dict

first you sort with -d into /tmp/look.dict, then you look with -t: and the string root:foobar. matching options = matching energy. periodt. ๐Ÿ’…


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

grep(1), sort(1) โ€” her besties. go say hi. ๐Ÿซถ


๐ŸŽ€ REPORTING BUGS ๐ŸŽ€

for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>. please be nice, she's trying her best. ๐Ÿ’œ


๐ŸŒˆ AVAILABILITY ๐ŸŒˆ

the look command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. go get her. โœจ


okay that's the whole page bestie, and just so you know the receipts: this is util-linux 2.42.4, dated 2026-09-21, and it's the LOOK(1) manual. no cap, that's literally everything. mwah ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from
  • arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms