HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

locate — Find filenames quickly. More information: <https://manned.org/locate>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandfilenamesfindquicklylocatecliinformationmore
linux

Problem

How to use the locate command: Find filenames quickly. More information: <https://manned.org/locate>.

Solution

locate — Find filenames quickly. More information: <https://manned.org/locate>.

Look for pattern in the database. Note: The database is recomputed periodically (usually weekly or daily):
locate "{{pattern}}"


Look for a pattern case-insensitively:
locate {{[-i|--ignore-case]}} "{{pattern}}"


Look for a file by its exact filename (a pattern containing no globbing characters is interpreted as pattern):
locate "*/{{filename}}"


Recompute the database. You need to do it if you want to find recently added files:
sudo updatedb

Code Snippets

Look for pattern in the database. Note: The database is recomputed periodically (usually weekly or daily)

locate "{{pattern}}"

Look for a pattern case-insensitively

locate {{[-i|--ignore-case]}} "{{pattern}}"

Look for a file by its exact filename (a pattern containing no globbing characters is interpreted as `*pattern*`)

locate "*/{{filename}}"

Recompute the database. You need to do it if you want to find recently added files

sudo updatedb

Context

tldr-pages: linux/locate

Revisions (0)

No revisions yet.