[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

How to use the locate command on Mac

Mac

My name is Ito, and I'm an infrastructure engineer who uses both Mac and Windows.

Speaking of Mac's file search function, it's Spotlight search!
However, with just the Spotlight function, I can't find configuration files that are deep in the hierarchy...

The "locate" command can be used in such cases. You can create an index database of files and search files quickly.
Although it is necessary to create and update the file index database, it is much faster compared to the find command.
By the way, the find command searches and displays files in real time, so it's not that fast.

So let's use the locate command to find the file! When I thought about it, I couldn't immediately use the locate command on Mac. .
This time, we will show you how to use the locate command on a Mac.

locate on Mac

This is how I got angry.
first-locate
Well, I thought it was because I hadn't used the updatedb command, but it said that there was no updatedb command. . .

updatedb

Then, read again what is written in the locate command.

WARNING: The locate database (/var/db/locate.database) does not exist. To create the database, run the following command: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist Please be aware that the database can take some time to generate; once the database has been created, this message will no longer appear.

Simply translated...

Note! locate database does not exist.
To create a database, execute the following command.

  sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

That's what I mean. . It wasn't the updatedb command.
So, let's execute the command as instructed.

I got worried because it was over in an instant, so I tried running it again...

launchctl

It seems like a database is being created behind the scenes.

It depends on the capacity of your Mac, so I can't say for sure, but try using the locate command again after about 5 minutes.

after-locate

The locate command returns results.
Isn't there rsyncd.conf? I'll write another article about this.

Now you can find library files that cannot be found even with the Spotlight feature!

If you found this article helpful , please give it a like!
0
Loading...
0 votes, average: 0.00 / 10
2,463
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

[Osaka/Yokohama] Actively recruiting infrastructure engineers and server side engineers!

The person who wrote this article

About the author