logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

look - find lines in a sorted list

Description

Look consults a sorted file and prints all lines that begin with string.  It uses binary search.

       The following options are recognized.  Options dfnt affect comparisons as in sort(1).

       -i     Interactive.   There  is  no  string argument; instead look takes lines from the standard input as
              strings to be looked up.

       -x     Exact.  Print only lines of the file whose key matches string exactly.

       -d     `Directory' order: only letters, digits, tabs and blanks participate in comparisons.

       -f     Fold.  Upper case letters compare equal to lower case.

       -n     Numeric comparison with initial string of digits, optional minus sign, and optional decimal point.

       -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.

       If no file is specified, /lib/words is assumed, with collating sequence df.

Diagnostics

       The  exit  status  is  ``notfound''  if no match is found, and ``nodictionary'' if file or the default
       dictionary cannot be opened.

                                                                                                    LOOK(1plan9)

Files

/lib/words

Name

       look - find lines in a sorted list

See Also

sort(1), grep(1)

Source

/src/cmd/look.c

Synopsis

look [ -dfnixtc ] [ string ] [ file ]

See Also