LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

slocate

Security-aware file location database

TLDR

Find file
$ slocate [filename]
copy
Case insensitive
$ slocate -i [filename]
copy
Update database
$ slocate -u
copy
Show statistics
$ slocate -S
copy
Limit results
$ slocate -n [10] [filename]
copy
Regex search
$ slocate -r "[pattern]"
copy

SYNOPSIS

slocate [-i] [-r] [-n num] [options] pattern

DESCRIPTION

slocate (Secure Locate) is a permission-aware version of the locate command that searches a pre-built database of file paths. Unlike standard locate, slocate only returns files that the searching user has permission to access, preventing information disclosure about file structures in restricted directories.The tool maintains a database indexed by file path, providing near-instant search results compared to real-time filesystem traversal with find. The database is typically updated periodically via cron, and supports both glob-style patterns and regular expressions for flexible matching.slocate has been largely superseded by mlocate, which uses a more efficient database format and is the default on most modern Linux distributions. Both provide the same security-aware behavior of filtering results based on the caller's file permissions.

PARAMETERS

-i

Case insensitive.
-u
Update database.
-S
Statistics.
-n NUM
Limit results.
-r REGEX
Regex pattern.
-e DIR
Exclude directory.

INSTALL

sudo apk add mlocate
copy
nix profile install nixpkgs#mlocate
copy

CAVEATS

Database may be stale. Root for update. Superseded by mlocate.

HISTORY

slocate (Secure Locate) was created by Kevin Lindsay to address security concerns with the original GNU locate, which could leak information about restricted files. It has been largely replaced by mlocate on modern Linux distributions.

SEE ALSO

locate(1), mlocate(1), find(1), updatedb(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid