Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux look Command

Linux look Command

Linux Command Reference Linux Command Reference

The Linux look command is used to look up words.

The look command is used to look up English words. You only need to give it the prefix string you want to search for, and it will display all words whose beginning matches that string.

Syntax

look [-adf][-t<字尾字符串>][字首字符串][字典文件]

Parameter Description:

Example

To find all lines in the testfile file that begin with the letter L, enter the following command:



look L testfile 

The contents of the original testfile are 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 on the testfile 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”开头,列出全句 

Linux Command Reference Linux Command Reference