Find files 🔍 using the locate command

Find files 🔍 using the locate command

locate = find data files, programs, directories, & objects matching your search.

For example:

locate license

Since you usually receive quite a long list when running locate, you’ll probably want to do this:

locate <search term> | more -or-
locate <search term> | less

locate searches a database called slocate.db on your hard drive which is updated every night. To manually update the database, login as root & then run:

updatedb

Note that locate searches by name only. To search by any other attribute, use find. To search only for commands, use whereis.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.