3 ms·
>`fd abc` is equivalent to `find. -iname 'abc'` If you don't want to install a tool just for this: fs() { find -iname '*'"$1"'*' ; } I don't really have
by asicsp 4y ago
>`fd abc` is equivalent to `find. -iname 'abc'`
If you don't want to install a tool just for this:
fs() { find -iname '*'"$1"'*' ; }
I don't really have big directories where speed would be a benefit, so haven't tried `fd` yet. I do use `ripgrep` but mostly for its features (like default recursive search respecting .gitignore, `-r` option, etc) over speed benefits.
- MayeulC 4y agotime find ~ -type f 6.99 user 10.66 system 53% cpu 33.218 total Second run: About the same (-0.32, -0.78, -1.929) time fd --type f 4.61 user 11.27 system 120% cpu 13.172 total Second run: 4.06 user 4.35 system 178% cpu 4.720 total That's on an SSD. Admittedly, fd skips over hidden files and some directories by default. Adding them back (-u), it seems to take about the same time. 13.74 40.58 145% 37.324 Though it falls back to 13s if I disable colored output. Piping these in wc -l to eliminate vt overhead, I have 1.4M matches, in about 5s for fd and 11s for find (warm runs, there is quite a bit of jitter). About 1s if I let fd skip hidden directories (.cache, .git, etc: 0.4M matches). Point is, it's usually noticeably more responsive for realistic use-cases (and has colored output, parses .gitignore files, etc).