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,--terminatecharacter โ 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