Find a file Search command under Linux

Source: Internet
Author: User

Under Linux, it is often necessary to find some files in a certain location. What to do? It's enough to use the Find command. Find Search-path Expressions Search-string

If you want to search the current directory. Then the search-path can be empty or a period '. '

If you look for files that were accessed 3 minutes before the current directory. Find. -amin 3

If you look for files that were accessed four days ago.

Find. -atime 4

If you look for a file with the file name changed 5 minutes ago. Find. -cmin 5

If you look for a file with a changed file name 6 days ago. Find. -ctime 6

If you look for a file that was modified 7 minutes ago. Find. -mmin 7

If you look for a file that was modified 8 days ago. Find. -mtime 8

If you look for a file with a file size of zero. Find. -empty

If you look for a file with index number 11331.

Find. -inode 11331

If you are looking for a file with the file name a.out. Find. -name a.out

If you want to find files with files named A.out and a.out.

Find. -iname a.out

Join to find a file with a permission value of 644. Find-perm 644

Join all files to query the current directory.

Find

Find-print

Another three options are more common.

-H does not follow symbolic links (but follows when processing command line arguments)

-L always follow symbolic connections

-P never follow a symbolic link (this is the default value)

Symbolic Links Symbolic Links

File type is L

Similar to the shortcut under Windows.

User default directory is ~

The current directory is.

The last directory was-

root directory is/

The previous level directory is:

    • Related articles recommended:
    • Linux Find command usage notes
    • The find command clears the Linux system junk file for you
    • Linux Find command-print0 and xargs-0 tips for using
    • This article from: Hobby Linux Technology Network
    • This article link: http://www.ahlinux.com/start/cmd/6870.html

Find a file Search command under Linux

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.