Find command in CentOS -- find the file name

Source: Internet
Author: User
1. find & ldquo; elm in a directory. cc & rdquo; file find/home/lijiajia/-nameelm. cc2. find the find/home/lijiajia/-name & #39; * elm * & #39; file with a certain character (such as & quot; elm & quot;) in the file name; find/home/lijiajia/

1. find the file named "elm. cc" in a directory

Find/home/lijiajia/-name elm. cc

 

2. find a file with a certain character (such as "elm") in the file name

Find/home/lijiajia/-name '* elm *'

Find/home/lijiajia/-name 'Elm *'

Find/home/lijiajia/-name '* elm'

 

3. search by file features

Find/home/lijiajia/-amin-10      # Search for files accessed in the last 10 minutes in the system

Find/home/lijiajia/-atime-2      # Search for files accessed in the last 48 hours in the system

Find/home/lijiajia/-empty       # Search for files or folders that are empty in the system

Find/home/lijiajia/-group cat     # Find the groupcat file in the system (tried, the command is incorrect .)

Find/home/lijiajia/-mmin-5       # Search for the files modified in the last 5 minutes in the system

Find/home/lijiajia/-mtime-1       # Search for the files modified in the last 24 hours in the system

Find/home/lijiajia/-nouser        # Search for files that belong to the void user in the system (I don't understand what it means)

Find/home/lijiajia/-amin 10      # Search for files accessed in the last 10 minutes in the system

Find/home/ftp/pub-user lijiajia   # Search for files belonging to the lijiajia user in the system

(PS: the above operations are performed in the/home/lijiajia/folder)

 

4. search for files using hybrid search

Find/tmp-size + 0000000c-and-mtime + 2    # Search for a file in the/tmp directory that is larger than 10000000 bytes and modified within 48 hours

Find/tmp-user tom-or-user george          # Search for files belonging to tom or george in the/tmp Directory

Find/tmp! -Usr fred                        # Find files that do not belong to fred in the/tmp Directory

 

5. search for and display files

Find/home/lijiajia/-name 'Elm. cc'-ls      # Search for files named "elm. cc" in the directory and display the information of these files

Related Article

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.