Linux look command
Linux look command queries word.
look for instructions in English word queries. You just want to give it a query string prefix, it will show all the beginning of a string in this condition word.
grammar
look [-adf][-t<字尾字符串>][字首字符串][字典文件]
Parameter Description:
- -a use another dictionary file web2, the file is also located in the / usr / dict directory.
- -d Compare only letters and numbers, and the rest will not ignore a generous comparison.
- -f Ignore character case differences.
- -t <suffix string> Set the suffix string.
Examples
To find the testfile file to all lines that begin with the letters L, you can enter the following command:
look L testfile
Testfile original file contents are as follows:
$ cat testfile #查看testfile 文件内容 HELLO LINUX! Linux is a free unix-type opterating system. This is a linux testfile! Linux test
Using the look command to find the "L" word in the beginning of the testfile file with the following results:
$ look L testfile #查找以“L”开头的单词 Linux is a free unix-type opterating system. #第二行以“L”开头,列出全句 Linux test #第四行以“L”开头,列出全句