Find files with locate

Whenever I am looking for a file, my first reflex is to use the find command. After all, it was made to do just that: search for files in a directory hierarchy.

find . -name "*rib*pdf"

Confession time! I cannot remember how find work without checking the man or tldr. To me, find is a tar...

tar

To my find issue, I found a solution: locate.

locate "*rib*pdf"

My current distribution already has it. If yours do not, you can search for the package mlocate.

I am aware of fd, but I did not try it yet. It may be even better.

source:



Tags: linux, shell, bash

← Back home