Linux Command - locate

locate - find files by name

Syntax

1
locate [OPTION]... PATTERN...

Description

locate reads one or more databases prepared by updatedb(8) and writes file names matching at least one of the PATTERNs to standard output, one per line. updatedb runs everyday by default, use /etc/crontab to update its config.

You can manually update the databse by executing updatedb command.

Example

locate vim

1
locate bin/vim

output

1
2
3
4
5
6
7
8
/snap/core/5897/usr/bin/vim.tiny
/snap/core/6034/usr/bin/vim.tiny
/snap/core/6130/usr/bin/vim.tiny
/usr/bin/vim
/usr/bin/vim.basic
/usr/bin/vim.tiny
/usr/bin/vimdiff
/usr/bin/vimtutor

Reference