3 ms·
Phew! I'm glad I've been hitting the "Happy Case" scenario all these years! Very useful article. And very informative. Summary: Instead of - find . -name
by thunderbong 7y ago
Phew! I'm glad I've been hitting the "Happy Case" scenario all these years!
Very useful article. And very informative.
Summary:
Instead of -
find . -name *.jpg
Use quotes around pattern i.e.
find . -name '*.jpg'
Edit: Oops, the double-quotes should have been single quotes! Thanks, @lucd. Happy case, like I said!
- lucd 7y agoWildcards are still expanded inside double quotes.. Yiu have to use single quotes.
- solarexplorer 7y ago...or a backslash.
- beamatronic 7y agoI use the backslash. I also specify -type f explicitly when I’m looking for files. find . -type f -name \*.txt Now the next article will talk about problems when there’s a space in the file names and you just piped the output into xargs :)
- chousuke 7y agoThat's not true. Variable expansion happens in double quotes, but globs stay untouched.
- waynecochran 7y agoYes but double quotes will work fine in this case -- globs won't be expanded...
- deleted 7y ago[deleted]