I’m on MacOSX 12.6, the following terminal command opens all the files I need, but it would be far more useful if the files opened in alphabetical order. For some reason everything is found, but opens in random order.
cd /Volumes/Disk2/Books; find ./ -type f -regex '.*[advert]_00[1-5]_2023\.pdf' -exec open {} \;
I can’t see anything in the find documentation to affect sort order in the output. Previous answers to this type of question don’t appear to work with ”-exec open’ (I might be doing this wrong, sorry, inexperienced, I’m here to learn!)
>Solution :
Instead of
find whatever -exec open {} \;
do
find whatever | sort | xargs -n 1 open
That’s assuming your file names don’t contain newlines.