Name

look — stdin  stdout  - file  -- opt  --help  --version

Synopsis

look [options] prefix [dictionary_file]

While writing in your text editor, consider the look command in a second Terminal window for quickly looking up the spelling of words. It prints words that begin with a given string (case-insensitively). The words come from a dictionary file, /usr/share/dict/words. For instance, the command:

look bigg

prints all words in the dictionary file that begin with those letters:

bigg
biggah
biggen
bigger
biggest
...

If you supply your own dictionary file—any text file with alphabetically sorted lines—look will print all dictionary lines that begin with the given prefix.

Useful options

-f

Ignore case.

-t X

Match the prefix only up to and including the termination character X. For instance, look -ti big prints all words beginning with “bi.”

Get Macintosh Terminal Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.