In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how Linux uses the locate command to locate files". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how Linux uses the locate command to locate files.
FIND command
Many Linux users like to use the find command to find files, for example, they usually like to do this:
Find /-name 'pattern'
It is true that the power of find is not only used to find files, it can be used to locate more detailed things, such as if you want to find some writable permissions (if you wanted to find files which are writable by both their owner and their group) for its owners and administrators in a directory, you can do this:
Find /-perm-444-perm / 222,222!-perm / 111,
Or you may want to see the files that have been modified in the past 24 hours in your download directory
Find / home/user/Downloads/-mtime 0
The power of the find command is not just for finding files, it takes time to search the disk. So is there a quick way to locate it?
LOCATE command
Before using locate, you need to make sure that the mlocate package is installed on your system, which is now integrated in most Linux distributions. If you do not have an installation, you can visit the mlocate home page (http://carolina.mff.cuni.cz/~trmac/blog/mlocate/) to download the installation. After the download and installation is successful, you need to execute a command to index your file system. Otherwise, you'll have to wait until the program executes automatically.
Executed the following command as root user:
Updatedb &
This command updates your mlocate database in the background, which contains the index of your file system (This updates the mlocate database that indexes your files and forks it to the background (the'& 'forks it to the background).
When this command is finished, you can easily use the locate command:
Locate firefox | less
This will quickly locate files, directories, and so on about firefox. It is also faster than find because it reads the index in the mlocate database!
At this point, I believe you have a deeper understanding of "how Linux uses the locate command to locate files". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.