2 points

I always just use

find | grep -i <partial file name>
permalink
report
reply
2 points

Well that’s clearly worse… Why even make this comment?

permalink
report
parent
reply
5 points

Because sometimes people want to share solutions that work for them. A clunky solution that you remember is better than the optimal solution you can’t access.

permalink
report
parent
reply
5 points

just use fd at that point

permalink
report
parent
reply
5 points
find <dir> -iname partialfilename\*

Is pretty much the “find-native” way to do the same thing

permalink
report
parent
reply
2 points

Why can’t I remember the find parameters?

I don’t know. Perhaps write a couple of aliases?

permalink
report
reply
2 points

I’m with the others: fd default syntax is easier to remember.

And for the interactive search I’m using skim. With it I cd to the dir I want and Alt t to trigger fuzzy finding. There are also bindings to search for dir or in the history. The neat part is that results are inserted as is in the command line, no need to xargs or copy them. It also make the history look like I always know where the files I want are when in reality they are just fuzzy-found

permalink
report
reply
7 points

So many linux posts seem to be new people getting frustrated at their lack of knowledge and trying to reinvent something that already exists. I’m looking at this thinking, why didn’t they just use locate and fzf?

permalink
report
reply
12 points

find can be a bit slow because it enumerates every directory recursively from the root you specified, but it let’s you do a lot more than just search by name. locate is available on most distros and give fast results, albiet from when the index was last rebuilt (usually nightly). They both have the vital property that they output a list of files to stdout for further processing.

permalink
report
reply
4 points

It’s worth mentioning you can manually kick off an index build with I believe updatedb (in most cases).

permalink
report
parent
reply
3 points

+1 for locate and updatedb. It works on macos too.

permalink
report
parent
reply

Linux

!linux@programming.dev

Create post

A community for everything relating to the GNU/Linux operating system

Also check out:

Original icon base courtesy of lewing@isc.tamu.edu and The GIMP

Community stats

  • 2.5K

    Monthly active users

  • 1.1K

    Posts

  • 9.2K

    Comments