Back to Blog
Dec 09, 2016 4 min read

Bash Locate (flocate)

Bash Linux

Bash Locate (flocate)

A fast locate-like tool that you can carry with you in your dotfiles, that only uses basic binaries available on most systems.

Motivation

Sometimes you are on a system where you don't have root access to install mlocate or similar tools. flocate is a simple bash script that creates its own index of files and allows you to search them quickly.

How it works

It uses find to generate a list of all files and stores them in a compressed file. When you search, it decompresses and greps through the list.

# Create index
find / -xdev > ~/.flocate.db 2>/dev/null

# Search
grep -i "$1" ~/.flocate.db

Thanks for reading!

I hope you found this technical dive useful. Feel free to connect with me if you have any questions or thoughts.

Connect with me
© 2026 Adam Lamers
Framework: Svelte_5
Runtime: Cloudflare