Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

File searcher-- detailed explanation of find command

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. File lookup:

In the linux system, because of the large number of files, it is often necessary to find a file among the many files. If it takes a long time, it is difficult to remember where the files are stored. However, you are not more worried about this, because developers provide us with powerful file search tools. Here are two commonly used file search tools: locate and find. These two lookup tools can only be found in the file system, not in memory, because memory does not have a file system.

2. Locate command:

Locate command is based on the database to find files, the command search speed is fast, general search with the new slow, name changes less, such as: configuration files, you can use locate search, because the database needs to be updated, so there will be a little delay, locate command is generally a daily update of the database, so it is possible that the newly created files can not be found, or just deleted files in the database. You can use updatedb to update database information, database file: / var/lib/mlocate/mlocate.db

Locate usage:

Locate option parameters

Options:

-e is excluded from the scope of search.

-Q quiet mode, no error message is displayed

-n display up to # outputs

-r supports regular expressions

-I ignore case

-b base name

Example:

[root@cnode6_8 etc] # locate-r'\

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report