How To Install Locate?

How To Install Locate?

locate

Find filenames quickly.

Maintainer: Tollef Fog Heen



Section: utils

Install locate

  • Debian apt-get install mlocate Click to copy
  • Ubuntu apt-get install mlocate Click to copy
  • Alpine OS apk add mlocate Click to copy
  • Arch Linux pacman -S mlocate Click to copy
  • Kali Linux apt-get install mlocate Click to copy
  • CentOS yum install mlocate Click to copy
  • Fedora dnf install mlocate Click to copy
  • Raspbian apt-get install mlocate Click to copy

Find filenames quickly.

How to use locate?

Below are few example commands for locate that you can use in the terminal.

Look for pattern in the database. Note: the database is recomputed periodically (usually weekly or daily):
locate patternClick to copy
Look for a file by its exact filename (a pattern containing no globbing characters is interpreted as `*pattern*`):
locate */filenameClick to copy
Recompute the database. You need to do it if you want to find recently added files:
sudo updatedbClick to copy
To install the latest version of locate in your favorite operating system just copy the locate installation command from above and paste it into terminal. It will download and install the latest version of locate 2024 package in your OS.