3 ms·
I've never claimed to be good at command-line-fu, but damn me if I can ever get a find command right first time. Honestly, I just run 'find . | grep' to achiev
by xen0 5y ago
I've never claimed to be good at command-line-fu, but damn me if I can ever get a find command right first time.
Honestly, I just run 'find . | grep' to achieve what I want these days.
- asicsp 5y agoI have this shortcut for such cases. An important difference from your command is that I'm still using glob, not regex. You can use `-regex` if needed. fs() { find -iname '*'"$1"'*' ; }
- enriquto 5y agofind|grep is perfectly alright. There's no shame in using it.
- avaika 5y agoAs long as you don't have files with newline character (which is totally valid, but fortunately not widely used). However even without newline it will be fun to process all the special symbols in file names if you decide to handle somehow the matched files. PS Unless I missed /s in your message, which I'm not always good at :)
- enriquto 5y agoI was being serious. Most often you get to choose, or at least to know, the names of your files. In those cases find|grep is very useful. You do not need your shell commands to always work in the fully general case.
- petepete 5y agoGive fd a try. It work how you'd expect find would. https://github.com/sharkdp/fd https://github.com/sharkdp/fd