4 ms·
The trailing slash is not the issue here. With `fd` the first argument is the pattern to search for, not the starting point like in `find`. For example to find
by eterps 4y ago
The trailing slash is not the issue here. With `fd` the first argument is the pattern to search for, not the starting point like in `find`.
For example to find fonts.conf below /etc, with fd you would do:
fd fonts.conf /etc
And with find:
find /etc -name fonts.conf
In other words with find the first argument is always the starting point. And leaving it out implies the current directory as the starting point.
- joveian 4y agoThere are --search-path and --base-path options, so if you alias say fd='fd --search-path' you can then have the required first argument be the path to search. Personally, I find changing to the directory I want to search in less annoying than typing out the directory to search (I know the options exist from script use).
- mekster 4y agoIf it wasn't for find's muscle memory, fd has it right as you'd usually list what you want to do in the cli first and then list arbitrary number of targets in the end.