Ahmed FASIH @22@octodon.social
Follow

It's a tad bit more involved when the filenames have spaces: one trick is to replace the newline with the null character using tr and tell xargs to expect null-terminated rows—it then ignores spaces, etc. A real example:

cat bad.txt | tr '\n' '\0' | xargs -0 -P8 -n1 -I% dropbox_uploader.sh delete "/Camera Uploads/%"

I have a list of bad filenames in bad.txt, and the superb Dropbox-Uploader github.com/andreafabrizi/Dropb will delete them eight at a time.