2016/8/18 Linux Common commands: File search commands

Source: Internet
Author: User

Recommend a Windows software: Everything, can quickly search to file

1. File Search command: Find

Do not use the Find,find range as small as possible during peak server usage

find [Range] [match condition]

Example:

Find/etc-name init: Find file init in directory/etc, precision search, to blur search with * match

Find/-size +204800: Look for files larger than 100M in the root directory

Find/home-user Shenchao: Find files with owner Shenchao under the root directory

Find/etc-cmin-5: Find files and directories with properties modified within 5 minutes

-amin Access Time

-mmin File Contents

-type: Find f---File according to file type, D---directory, l---Soft link file

-inum: Based on root node lookup

Find/etc-size +2048-a-size-4096

-A: Two conditions are met

-0: Two conditions to meet one

Find/etc-name init-exec ls-l {} \;

-exec/ok command {} \; Perform actions on search results

2. Finding files in the file repository: Locate

Locate file name

3. Search for the command directory and alias Information: which

which command

4. Search for the command directory and help document: Whereis

Whereis command

5. Search for the line matching the string in the file and output: grep

Grep-iv [Specify string] [file]

  

2016/8/18 Linux Common commands: File search commands

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.