Good Linux question — answering as the UphillTech team:
Figured out what I had to do loop-wise, just needed to get a hang of the loop syntax . Hope this helps someone else out that might need to loop through a sub-directory based on it's name. for dir in / do for subdir in $PWD/"$dir"/ do if [ "$subdir" == $PWD/"$dir""Drawings"/ ] then for file in "$subdir".jpg do rm "$file" done for file in "$subdir".pdf do newName="${file/.pdf/}" convert -density 200 "$file" -append -resize 850 -background white -flatten "$newName".jpg done for file in "$subdir".jpg do newName="${file/.jpg/}" if [[ "$file" == "insulation" ]] then convert "$file" -crop...
Full answer by Edward S Bernstein: https://askubuntu.com/a/847992 (CC BY-SA 3.0).
Need Linux help for your business? UphillTech.