S Print some statistics about the database and exit. There are a couple extra options ( man locate): -0 Print pathnames separated by an ASCII NUL character (character code 0) instead of default NL The syntax to search a file or directory is simple you only need put the command locate next to the file or directory name: locate Now you can restart the terminal session and updatedb is avaliable. I have a symlink to the binary file, this way you don't need introduce the whole path every time: sudo ln -s /usr/libexec/locate.updatedb /usr/local/bin/updatedb The first time it takes a long time to create the database. This command to update the database: sudo /usr/libexec/locate.updatedb We need to update the database of files and directories it is recommended to update the database after a time.
These are the steps to use locate on Mac: Update the database The command locate is present in the Unix system, and its functionality is search files or directories in our system, it uses a database so after we update the database the search is very fast.