How to use the Linux look command

Source: Internet
Author: User

The look command is used to query English words. You only need to give it the first character string to be queried. It will display all the words whose start character string meets this condition.

Syntax

Look [-adf] [-t <character string>] [character string] [Dictionary File]

Parameter description:

  • -A uses another dictionary file web2, which is also located in the/usr/dict directory.
  • -D: only English letters and numbers are compared.
  • -F ignores the case sensitivity of characters.
  • -T <suffix string>: specifies the suffix string.

Instance

To search for all lines starting with the letter L in the testfile file, enter the following command:

Look L testfile

The content in 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

Use the look command in the testfile to search for words starting with "L". The result is as follows:

$ Look L testfile # search for words starting with "L"

Linux is a free unix-type opterating system. # The second line starts with "L" and lists the entire sentence.

Linux test # Line 4 starts with "L" and lists the entire sentence

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.