[Shell] uses the Find command to locate recently modified files __ Memo Material

Source: Internet
Author: User
Tags readable

Find command: Search for files in specified directory

commonly used option:

-name: Specify the filename, or use "*.py" to specify the suffix name of the file, such as searching all the py files under the/home directory

Find/home-name ' *.py '

-type: Specifies the type of file to search for, common file types include: B for block devices, C-character devices, D file directories, f Common files, etc., such as searching for block device files in/dev directory:

sudo find/dev-type b

-readable: File readable

-writable: Files can be written

-executable: File Executable

-ls: Displays the file details in the search results

Find/home-name "*py"-ls


-empty: Normal file or folder is empty


Find recently modified files: -ctime: Permissions for files in the specified time have been modified, change

-atime: Files are accessed (read) within a specified time, access

-mtime: The specified time (in days) the file has been modified, modify

-mmin: Specified time (in minutes) the file has been modified, modify

Find the. c file that was modified within 30 minutes of the/home path:

Find/home-mmin-30-name "*.C"

Find the block normal files that have been modified in the last 1 days in the/home path:

Find/home-mtime 0-type F
Find the normal files that have been modified in the current directory for the last 24-48 hours, and display more information

Find. -mtime 1-type F-ls




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.