Introduction to FFF: Find Files Fast
In the Linux world, locating files quickly can save hours of work and improve productivity. The FFF method (Find Files Fast) combines classic and modern tools to offer instant and precise searches, adapting to both novice users and experienced system administrators.
Essential FFF Tools
- find: the classic utility for searching by name, type, size, modification date, and more.
- fd: a friendly alternative to
findwith simplified syntax, default colors, and improved performance. - grep / ripgrep (rg): search for content within files using regular expressions; ripgrep is notably faster and respects .gitignore by default.
- fzf: fuzzy finder that allows filtering results in real time via an interactive interface with preview.
Typical Workflows
- Locate by name or extension: use
fd -e pdfto find all PDFs orfind . -name '*.conf'for configuration files. - Filter with fzf: piping like
fd --type f | fzf --preview 'bat --style=numbers --color=always {}'shows a preview of the selected file. - Search within content: once the file is selected, run
rg 'pattern'orgrep -R 'pattern' .to locate specific text. - Quick actions: open the result with the default editor (
xdg-openorcode), copy the path to the clipboard (pbcopyon macOS orxclip -selection clipboardon Linux), or delete files directly from the command line.
Tips to Optimize Your Searches
- Limit the scope with
-type for-type dto avoid unnecessary results from directories or devices. - Use filesystem attributes:
fd --hiddenincludes hidden files when needed, and--no-ignoreomits .gitignore filters. - Save frequent searches as aliases or shell functions, for example:
ff() { fd --type f | fzf --preview 'bat --style=numbers --color=always {}'; }. - Take advantage of the
locatecache for ultra‑fast searches on systems where the database is updated regularly (sudo updatedb). - Combine multiple criteria:
fd -e txt -X grep -l 'TODO'finds all text files containing the word TODO.
Conclusion
Adopting the FFF approach transforms the way you interact with the filesystem on Linux. With the right tools and a well-defined workflow, finding any file goes from being a tedious task to an almost instantaneous operation, freeing up time for more creative and productive tasks.
This post is also available in ESPAÑOL.