Please show me how this code can get shorter:
find /home/peace/* -iname "*.pdf" -exec pdfgrep -i yello {} \; -exec cp {} /home/peace/Desktop/yello \;
find /home/peace/* -iname "*.pdf" -exec pdfgrep -i green {} \; -exec cp {} /home/peace/Desktop/green \;
find /home/peace/* -iname "*.pdf" -exec pdfgrep -i blue {} \; -exec cp {} /home/peace/Desktop/blue \;
find /home/peace/* -iname "*.pdf" -exec pdfgrep -i grey {} \; -exec cp {} /home/peace/Desktop/grey \;
find /home/peace/* -iname "*.pdf" -exec pdfgrep -i black {} \; -exec cp {} /home/peace/Desktop/black \;
find /home/peace/* -iname "*.pdf" -exec pdfgrep -i white {} \; -exec cp {} /home/peace/Desktop/white \;
green? anyways it's completely pointless to a) run multiplefindinstances and b) continue to search in the file after the pattern was found, so you may experiment with something likefind /some/path -name '*.pdf' -exec sh -c 'for f; do str=$(pdfgrep -iom1 "\<(yellow|green|blue|other_color)\>" "$f") && echo mv "$f" "/path/to/$str.pdf"; done' sh {} +mvwithcpin my command above.