Linux locate quick search command Introduction

Source: Internet
Author: User

 

It's a year before the New Year. I haven't shared it with you for a long time, and my work is too busy.

 

Anyone using linux will know the find command.

 

The following describes how to use the find command in linux.

 

The following describes a quick search tool locate that supports regular expressions.

 

Generally, linux is installed by default. Do not worry if no default installation is available.

 

Ubuntu: sudo apt-get install locate;

 

Centos: yum-y install mlocate;

 

Working principle: regularly generate data files related to file names through scheduled tasks (usually stored in [/var/lib/mlocate. db]), of course, the scheduled task will not be very real-time, this will cause the software you just installed to not find, at this time you need to use (updatedb) to update the locate data file.

 

 

Usage: locate xx (file name to be searched)-l num (number of rows to be displayed ). Of course, this file name appears too many in the system, you need to use the-l parameter. Or wait for the screen to be refreshed.

 

Regular Expression parameters:-r,-regexp REGEXP

 

Search for a basic regexp REGEXP. No PATTERNs are allowed ifthis option is used, but this option can be specified multiple

Times.

More usage: man locate;

 

Http://linux.about.com/od/commands/l/blcmdl1_locate.htm

 

Source: Martin blog

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.