LOOK(1plan9)

πŸ’– LOOK(1plan9) πŸ’–

okay bestie, so this is look from the Plan 9 manual, section 1, and it's literally the most underrated lil tool. it finds lines in a sorted list. that's it. that's the whole vibe. πŸŽ€


✨ NAME ✨

look β€” find lines in a sorted list πŸ”


🌸 SYNOPSIS 🌸

look [ -dfnixtc ] [ string ] [ file ]

πŸ’… DESCRIPTION πŸ’…

so look walks up to a sorted file and prints every single line that begins with string. and the way it does it? binary search. no cap, it's fast, it's elegant, it's giving main character energy. ✨

here's the options it recognizes, and heads up β€” the options dfnt affect comparisons exactly the same way they do in sort(1), iykyk. 🫢

  • -i β€” Interactive. there's no string argument at all; instead look takes lines from the standard input and treats each one as a string to be looked up. so you just keep feeding it vibes. πŸ“
  • -x β€” Exact. print only the lines of the file whose key matches string exactly. no fuzzy matching, no extras, just precision. πŸ’…
  • -d β€” `Directory' order: only letters, digits, tabs and blanks participate in comparisons. everything else is lowkey ignored. πŸ™ˆ
  • -f β€” Fold. upper case letters compare equal to lower case. so A and a are besties now. πŸ’œ
  • -n β€” Numeric comparison with an initial string of digits, optional minus sign, and optional decimal point. numbers getting the respect they deserve. πŸ”₯
  • -t[c] β€” character c terminates the sort key in the file. by default, tab terminates the key. if c is missing, the entire line comprises the key. that's the whole line, bestie, no crumbs. 😭

and if you don't specify a file? look just assumes /lib/words, with collating sequence df. iconic default behavior honestly. πŸ‘‘


πŸ¦‹ FILES πŸ¦‹

  • /lib/words

🌈 SOURCE 🌈

  • /src/cmd/look.c

πŸŽ€ SEE ALSO πŸŽ€


⭐ DIAGNOSTICS ⭐

listen up, this part matters! πŸ‘€

the exit status is not found''</red> if no match is found, and <red>no dictionary'' if file or the default dictionary cannot be opened. so if things go quiet, check your exit status, bestie. πŸ’€


and that's the whole page!! 🌸 this was LOOK(1plan9) from the Plan 9 manual, section 1 β€” mwah, slay, periodt. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from