Linux look Command
The Linux look command is used to query words.
The look command is used to look up English words. You only need to give it the prefix string of the word you want to query, and it will display all words whose beginning string matches the condition.
Syntax
look [-adf][-t<字尾字符串>][字首字符串][字典文件]
Parameter Description:
- -a Use another dictionary file web2, which is also located in the /usr/dict directory.
- -d Only compare English letters and digits, all others are ignored and not compared.
- -f Ignore case differences in characters.
- -t<suffix string> Set the suffix string.
Example
To find all lines starting with the letter L in the testfile file, you can enter the following command:
look L testfile
The content of the original file testfile is as follows:
$ cat testfile #查看testfile 文件内容 HELLO LINUX! Linux is a free unix-type opterating system. This is a linux testfile! Linux test
Use the look command in the testfile file to find words starting with "L", the result is as follows:
$ look L testfile #查找以“L”开头的单词 Linux is a free unix-type opterating system. #第二行以“L”开头,列出全句 Linux test #第四行以“L”开头,列出全句Other Extensions
Linux Command Encyclopedia