1

find: Why is the -a operator not commutative in combination with -print?

view story
linux-howto

http://unix.stackexchange.com – Supposing we're using find in current directory with audio files (e. g. MP3) and (important!) also non-mp3 files (e. g. JPEG) present in current directory or somewhere below it. Let's also assume we have an exclude_me directory in there with some other audio files, which should live up to its name by being excluded from the file search: find . \( -type d -name 'exclude_me' -prune \) -o \( -type f -a -iname '*.mp3' -a -print \) (Though not absolutely necessary in this case, I've deliberately set some redundant parentheses, as well as additional -a operators for the sake of clarity.) This wi (HowTos)