Locate files (find)

list files in databases that match a pattern - Locate man

Basic Syntax

$ locate filename
$ locate  -c*apache*.”    # count the number of occurrences
$ locate  -c*.jpg*$ locate  -i lego           # to ignore case sensitivity

$ locate -S                 # show info & stats from db

updatedb

The db used by locate is updated by updatedb from conf found in /etc/updatedb.conf Default db is located at /var/lib/mlocate/mlocate.db

updatedb is usually run daily by cron(8) to update the default database.

check /etc/cron.daily for mlocate

Atlernatively use

Find

$ find . -type d -empty -delete
Written on October 10, 2021, Last update on November 1, 2021
cli search find file