• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

updatedb: command not found

by admin

The updatedb command is used to build a database of files based on the /etc/updatedb.conf file. This command is used to update the /var/lib/mlocate/mlocate.db database. The /etc/updatedb.conf file consists of the paths that should be excluded while building the database. To add a path that needs to be excluded while building the database, open the /etc/updatedb.conf file and, in the PRUNEPATH variable, specify the path that need not be included while building the database. For example, PRUNEPATH=”/etc” will exclude the /etc directory while building the database.

Though this is the default database searched by the locate command, there may be more databases containing file paths. If the database is not updated before performing a search, all files created after the last update will be excluded from the search.

If you encounter below error while running the updatedb commnad:

updatedb: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install mlocate
Ubuntu apt-get install mlocate
Alpine apk add mlocate
Arch Linux pacman -S mlocate
Kali Linux apt-get install mlocate
CentOS yum install mlocate
Fedora dnf install mlocate
Raspbian apt-get install mlocate

updatedb Command Examples

1. Refresh the slocate database, excluding files in temporary locations:

# updatedb -e "/tmp,/var/tmp,/usr/tmp,/afs,/net,/proc"

2. to create an index yourself of a directory and all its subdirectories (say, storing it in /tmp/myindex), run:

# updatedb -l0 -U directory -o /tmp/myindex

3. Refresh database content:

# updatedb

4. Display file names as soon as they are found:

# updatedb --verbose

Filed Under: Linux

Some more articles you might also be interested in …

  1. snapper: command not found
  2. CentOS / RHEL : How to convert volume group metadata between LVM1 and LVM2
  3. lvresize: command not found
  4. fdupes: Finds duplicate files in a given set of directories
  5. 10pt loadable: Metric (TFM) file not found
  6. grub-bios-setup Command Examples in Linux
  7. compgen: A built-in command for auto-completion in Bash, which is called on pressing TAB key twice
  8. chntpw : command not found
  9. How to troubleshoot NFS transfer latency issues using “nfsiostat” in CentOS / RHEL
  10. Permission Table for a File/Directory And File System Users Types

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright