xargs -0: (thanks to quizac@wykop)

pull/2/head
Igor Chubin 7 years ago
parent 6af7057594
commit 9214ff1e83

@ -1,6 +1,12 @@
# find all file name ending with .pdf and remove them
find -name \*.pdf | xargs rm
# find all file name ending with .pdf and remove them
# (bulletproof version: handles filenames with \n and skips *.pdf directories)
# -r = --no-run-if-empty
# -n10 = group by 10 files
find -name \*.pdf -type f -print0 | xargs -0rn10
# if file name contains spaces you should use this instead
find -name \*.pdf | xargs -I{} rm -rf '{}'

Loading…
Cancel
Save