3 ms·
I wrote a post about how to understand find syntax: find and test: How To Read And Write Them https://www.oilshell.org/blog/2021/04/find-test.html https://www
by chubot 4y ago
I wrote a post about how to understand find syntax:
find and test: How To Read And Write Them
https://www.oilshell.org/blog/2021/04/find-test.html https://www.oilshell.org/blog/2021/04/find-test.html
tl;dr The args AFTER the root dir args form a boolean expression language -- I call it the "I'm too lazy to write a lexer" pattern
find /tmp -type -f -a -name 'foo*'
test is the same way, e.g.
test -f /tmp -a -f /bin
- michaelcampbell 4y agofind /tmp -type f -a -name 'foo*' # no "-" for the -type this is bitten me more often than I'd care to admit.
- chubot 4y agoOops, good point! Gah I honestly wonder where this wonky syntax came from ... i.e. was it a Bell Labs thing or later