Find command in Linux--Look up file name

Source: Internet
Author: User

1. Look for a file named "elm.cc" in a directory

find/home/lijiajia/-name elm.cc

2. Find files in the file name that contain a character (such as "Elm")

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

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

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

3. Query according to the characteristics of the document

find/home/lijiajia/-amin-10 #查找在系统中最后10分钟访问的文件

find/home/lijiajia/-atime-2 #查找在系统中最后48小时访问的文件

find/home/lijiajia/-empty #查找在系统中为空的文件或者文件夹

find/home/lijiajia/-group Cat # finds files that belong to Groupcat in the system (tried, the command is incorrect.) )

find/home/lijiajia/-mmin-5 # Find files that have been modified in the last 5 minutes of the system

find/home/lijiajia/-mtime-1 #查找在系统中最后24 hours of modified files

find/home/lijiajia/-nouser #查找在系统中属于作废用户的文件 (I don't know what that means)

find/home/lijiajia/-amin #查找在系统中最后10分钟访问的文件

Find/home/ftp/pub-user Lijiajia #查找在系统中属于lijiajia这个用户的文件

(PS: The above is done under the/home/lijiajia/folder)

4. Find a file using a hybrid lookup method

Find/tmp-size +10000000c-and-mtime +2 #查找 a file larger than 10000000 bytes in the/tmp directory and modified within 48 hours

Find/tmp-user Tom-or-user George #查找 files belonging to the two users of Tom or George in the/tmp directory

Find/tmp! -USR Fred #查找 The files that are not part of Fred in the/tmp directory

5. Find and Display files

find/home/lijiajia/-name ' elm.cc '-ls # Find files named "elm.cc" in the directory and display information about these files

Find command in Linux--Look up file name

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.