Detailed description of the find command for Linux Commands

Source: Internet
Author: User
For details about the find command of Linux commands, the find command is a common command used to search for files in UNIX file systems. it can be used to search for many conditions. Let's take a look at some find command instances. Syntax: find path constraints how to find a file with a specified keyword in the file name? The find command in Linux is a common command used to search for files in UNIX file systems.
Let's take a look at some find command instances. Syntax: find path constraints how to find a file with a specified keyword in the file name? The following command finds all files whose names contain "mail" in the "/etc" directory. # Find/etc-name "* mail *" www.2cto.com how to find a file whose size exceeds the specified value? The following command lists all files larger than 100 MB in the system # find/-type f-size + M How to find files that have not been modified in the last few days? The following command lists the files that have not been modified in the current directory in the last 60 days # find.-mtime + 60 How to find the files that have been modified in the last few days? The following command will list the files that have been modified in the current directory in the last two days # find.-mtime-2. how can I delete compressed files with an extension name of .tar.gz and greater than MB? When you do not want to accidentally delete a file, be careful when executing the following commands.
The best way is to use "ls-l" to execute the following command to ensure that you know what files will be deleted when executing the rm command. Www.2cto.com # find/-type f-name * .tar.gz-size + 100 M-exec ls-l {}\; # find/-type f-name * .tar.gz-size + 100 M-exec rm-f {}\; how to archive files not modified in recent days? The following command finds the file that has not been modified in the "/home/jsmith" directory for the last 60 days and creates an archive file named "export ddmmyyyy_archive.tar" under "/tmpdetail" # find/home/jsmith-type f -mtime + 60 | xargs tar-cvf/tmp/'date '{d=m=y'_archive.tar: you can use "midnight commander" to perform operations on files,
It is a very powerful file manager on the UNIX character interface. This article is from Qingteng Garden
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.