Linux File Search and operations

Source: Internet
Author: User

Linux File Search and operations

In linux, the most common method to find files is the find command. Let's take a look at how to use the find command:

Find

Find.-name txt // find the file or style folder named txt in the current directory
Find.-type c // character device
Find.-type d // directory
Find/dev-type B // block Device
Find/dev-type s // Network Device
Find/dev-type l // Link Device
Find/dev-type p // pipeline Device
Find.-size 141c // hit a file with 141 bytes
Find.-size + 100c-size-5000c // find the file or folder with the number of bytes greater than 100 and smaller than 5000
Find.-empty // enter an empty file
Find.-perm 644 // The 644 permission is found
Find.-gid 0 // The Group id is 0
Find.-uid 0 // the user ID is 0

Find.-empty-exec rm-rf {}\; // locate the empty file and delete it.
Find.-empty-exec cp {}/root/Desktop/-r \; // find the empty file and copy it to the Desktop

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.