Find command, find

Source: Internet
Author: User

Find command, find

Find

# Format: find [path] [parameter] [expression]-exec command {}\;
-{} Indicates the file found by find.
-\ Prohibit conversion; indicates that the instruction of the Bank has ended
# Find/sbin-type f-size + 1 M-exec ls {}\;
-- In the/sbin directory, find that the file type is regular and the file size is greater than 1 MB. Then run the ls command to check the file type.
# Find/sbin-type f-size + 1 M-exec cp {}/tmp \;

Parameters:

-Name: searches for files by file name.
# Find/-name "*. conf"

-Perm searches for files based on the file permissions.
# Find/-perm 755 | find/tmp-perm 755-ls

-The user searches for files based on the file owner.
# Find/-user student

-The group searches for files based on the group to which the files belong.
# Find/-group student

# Find/-user vip01! -Group upl_vip

-Newer file1! File2 searches for files whose change time is newer than file1 but older than file2.
# Find/home/-newer kk

-Type: search for a certain type of files, such:
B-block device files. D-directory. C-character device file. P-MPs queue file. L-Symbolic Link file. F-common file.
# Find/dev/-type B-ls

-Size n: [c] searches for files with a length of n blocks. If a file contains c, the file length is measured in bytes.
Find/etc/-size 585c c indicates the character-585c is smaller than + 566c is greater
Find/tmp/-size 2 greater than 2-2 less than 2

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.