Linux Command (use of-a,-o, not in find)

Source: Internet
Author: User

Linux Command (use of-a,-o, not in find)

Sudo find/etc-size + 1 M-exec echo {}\; # find and display files of a size greater than 1 MB in the/etc directory. The files are separated by line breaks. Sudo find/etc-size + 1 M | xargs echo # files that have the same-exec function but are searched with spaces. # {} \; After-exec is indispensable. Find follows the specified absolute path to start searching. I will take the current path. Find./-user Username # find is followed by the start to find the path name, which will be recursively searched in this path. #-User specifies the user name find. /-not-user name find. /-not-name file name find. /-not-type (general file f, Directory d, character file c) # Find unmatched files. Find./-user username-o-type f # find the user files in the current directory that you specify or (-o) General files. Find./-size + 1 M-o-type d # search for files or directories with a size greater than 1 MB in the current directory. Find./-size-1 M-a-type f # find the file in the current directory that is smaller than 1 MB and the file type is normal. -O is or means-a is and-not is the opposite. Based on the above, you can combine any of the methods you are willing to find. Find/etc-not-perm mode (222) find/etc-not-perm-mode (-222) find/etc-not-perm + mode (+ 222) #-perm is based on the File Permission to find the file mode, which exactly matches the corresponding permission, if suid/sgid/sticky-mode is not included, all the values of 1 after the permission bit is converted to binary must be matched. + mode requires that either 1 be matched. -Mode should contain mode, and + mode contains-mode.


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.