4 ms·
Whenever you run 'time <command>' you could consider running 'hyperfine <command>' to get an answer that has been averaged over multiple runs. I personally use
by sharkdp 9y ago
Whenever you run 'time <command>' you could consider running 'hyperfine <command>' to get an answer that has been averaged over multiple runs.
I personally use command-line benchmarking to compare different tools. You might want to compare grep, ack, ag and ripgrep. I currently use it to profile my find-alternative fd and to compare it with find itself (https://github.com/sharkdp/fd-benchmarks https://github.com/sharkdp/fd-benchmarks).
You could also use it to find an optimal parameter setting for a command-line tool (make -j2 vs. make -j8).
- Dowwie 9y agoI'd use fd if it didn't require a blackbelt in regex, maybe by adding more comprehensive examples? How could you do something like: find . -iname "<asterisk>any<asterisk>thing<asterisk>" HN won't let me use * so I had to tag them accordingly.
- deleted 9y ago[deleted]
- asicsp 9y agoadd four spaces at start of line find . -iname '*any*thing*'
- Dowwie 9y agoGreat. I'm officially a user!
- sharkdp 9y agoThe regex-equivalent for "anything" is usually "<dot><asterisk>" where the dot is for "any character" and the asterisk is for "any number of times (including zero)". fd does necessarily pattern-match at the beginning of the file name, so there is no need for an asterisk at the beginning and at the end of the pattern. Your example would be: fd 'any.*thing'