Linux look Command
The Linux look command is used for querying words.
The look command is used for querying English words. You only need to provide it with the initial string of the word you want to query, and it will display all words that start with that string.
Syntax
look [-adf][-t<suffix string>][prefix string][dictionary file]
Parameter Description:
-a Use another dictionary file web2, which is also located in the /usr/dict directory.
-d Only compare English letters and numbers, ignoring all other characters.
-f Ignore case differences.
-t<suffix string> Set the suffix string.
Example
To find all lines in the testfile file that start with the letter "L", you can enter the following command:
look L testfile
The content of the testfile file is as follows:
$ cat testfile # View testfile file content
HELLO LINUX!
Linux is a free unix-type opterating system.
This is a linux testfile!
Linux test
Using the look command to find words starting with "L" in the testfile file, the result is as follows:
$ look L testfile # Find words starting with "L"
Linux is a free unix-type opterating system. # The second line starts with "L", display the entire sentence
Linux test # The fourth line starts with "L", display the entire sentence