look—displays lines beginning with a given string

look [-dfa] [-t termchar] string [file]

look displays any lines in a file that contain a string as a prefix. As look performs a binary search, the lines in the file must be sorted. If a file is not specified, the file /usr/dict/words is used, only alphanumeric characters are compared, and the case of alphabetic characters is ignored.

OPTIONS:

-d Dictionary character set and order; i.e., only alphanumeric characters are compared.
-f Ignores the case of alphabetic characters.
-a Uses the alternate dictionary /usr/dict/web2.
-t Specifies a string termination character; i.e., only the characters in string up to and including the first occurrence of the termination character are compared. ...

Get Linux Shells by Example 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.