The look
command is used to search for words by specifying only the prefix string to be queried, and it will display all the words whose starting string matches the given condition.
-a, --alternative
: Use an alternative dictionary file.-d, --alphanum
: Use the standard alphanumeric character set and order, i.e., only compare space and alphanumeric characters. If no file is specified, this option is enabled by default.-f, --ignore-case
: Ignore the case of alphabetic characters. If no file is specified, this option is enabled by default.-t, --terminate character
: Specify a string termination character, i.e., only compare characters in the string up to the first occurrence of the character, including the first occurrence of the character.-V, --version
: Output version information.-h, --help
: Output help information.Use look
to find words starting with ab
.
Find words starting with L
in a file and display the entire sentence.
In the above example, use -t
to specify a string termination character, i.e., only compare characters in the string up to the first occurrence (including the first occurrence) of the character.