On Linux, how can I quickly find a file?

Source: Internet
Author: User

On Linux, how can I quickly find a file?

I have seen one sentence before: the level of Linux is reflected in the quick file searching ~~~ , Maybe this sentence is actually said.

But on Linux, everything is a file, and anything we want to do can be done by editing the file, such as server configuration and maintenance. Everything is in the process of dealing with files ~ ·~ ·

Next I will show you how to quickly find a file

Assume that

Find the script file (Execution file) which filename

Find the binary file (Execution file) whereis-B filename

Find the specific file whereis filename (using the database)

Part of the locate file name (search by database)

The above description uses database search and the database is a file with all files on your computer. Is it clear?

That is, file/var/lib/mlocate

Use locate when you cannot remember the full name of the file. You can also use the search command to add the wildcard *

For example, find the file yum. conf.

Whereis yum .*

The screen will output a file prefixed with yum.

Next, I will introduce a powerful but time-consuming command. How long will it take? Because it is a direct hard disk search

We know that we need to extract the content from the hard disk to the memory.

Is it powerful? Look down

Find/etc-mtime 3 what does it mean? Is to find the modified files on the day three days ago.

It is very useful. For example, we configured the server in January November 11, 2014. We want to see

If you have modified the file, enter find/etc-mtime 3 on the client.

Find/boot-newer/boot/gurb. conf

Find new files under the/boot directory than/boot/gurb. conf

Search for files belonging to fuchao in the root directory

Find/home-user fuchao

Find Files that do not belong to anyone in the system (ps: this is a bit interesting ~~~)

Find/-nouser

Search for files with special permissions

Find/-perm + 7000 --- s -- t

Locate/-perm + 600

Detailed description of the find command in Linux

Use of find, a text search tool

Powerful find command

Detailed description of the find command in Linux

This article permanently updates the link address:

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.