Hot answers tagged

3

You can look at the "/Producer" line: find -name '*.pdf' | xargs grep -al '^/Producer (pdfTeX' or with double quotes find -name '*.pdf' | xargs grep -al "^/Producer (pdfTeX" or with null-separated list of files find -name '*.pdf' -print0 | xargs -0 grep -al '^/Producer (pdfTeX'


1

Mac OSX xargs does not support long options like GNU xargs. For using --replace like GNU xargs, use -I: find docs/ -name "*png" | xargs -I F python myscript.py "F" Note that this approach breaks with file name contain newline, you want to use find -print0 with xargs -0: find docs/ -name "*png" -print0 | xargs -0 -I F python myscript.py "F" or standard ...


1

xargs on Mac OS X doesn't support the --replace option; you can use -I instead: find docs/ -name "*png" | xargs -I F python myscript.py "F" The strange error message is produced because this version of xargs interprets characters after a single - as options, so with --replace it's looking for an option named -, which doesn't exist.


1

Based on L.Levrel response, using the tools supplied in OS X (this should also work in Ubuntu). find . -type f -name '*.pdf' -exec grep -alE '/Producer \(pdfTeX|/Producer\(pdfTeX' {} +


1

From http://apple.stackexchange.com/questions/69223/how-to-replace-mac-os-x-utilities-with-gnu-core-utilities Brew install coreutils your commands will be accessible with g préfix so call gsplit



Only top voted, non community-wiki answers of a minimum length are eligible