English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux 'look' command

Linux Command大全

The Linux 'look' command is used for querying words.

The 'look' command is used for querying English single words. You only need to give it the initial string of the word you want to query, and it will display all words that start with the given string.

Syntax

look [-adf][-t<tail string>][head string][dictionary file]

Parameter Description:

  • -a Use another dictionary file web2,the file is also located in/usr/In the dict directory.
  • -d Only compare English letters and numbers, ignore the rest and do not compare.
  • -f Ignore case differences.
  • -t<tail string> Set the tail string.

Online Examples

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 # View the content of the testfile  
HELLO LINUX!  
Linux is a free unix-type opterating system.  
This is a linux testfile!  
Linux test 

The results of using the look command to find words starting with 'L' in the testfile file are as follows:

$ look L testfile                              # Find words starting with 'L'  
Linux is a free unix-type opterating system.   # The second line starts with 'L', and list the whole sentence  
Linux test                                     # The fourth line starts with 'L', and list the whole sentence 

Linux Command大全