look - Finds lines in a sorted list
look [-df] [-tcharacter] string [file]
command prints all lines in a sorted file
that begin with
Uses dictionary order; only letters, digits, tabs, and spaces
are used in comparisons.
Searches without regard to case; treats uppercase and lowercase
following it in the search
string. If you specify
look -tC ABCDE, the
would become (in effect)
being ignored. This option is primarily for shell scripts,
in which more than one
is being processed.
If no file is specified, look searches in the system word list /usr/share/dict/words, with the options -df assumed by default.
The look command uses binary search.
options affect comparisons
In order to use the -f option, you must first sort file with the sort -f command; otherwise, look displays only lowercase items.
If you do not specify
-f, but specify a
has been sorted with
may not produce any output.
To search a sorted file called sortfile for all lines that begin with the string as, enter: look as sortfile To search the system word list for all words beginning with smi, enter: look smi
System word list.
Commands: grep(1), sort(1), spell(1)