Skip to content

Instantly share code, notes, and snippets.

@yuikns
Created February 7, 2019 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuikns/e858eee4da1ee5754f055e01adb2e77c to your computer and use it in GitHub Desktop.
Save yuikns/e858eee4da1ee5754f055e01adb2e77c to your computer and use it in GitHub Desktop.

rsync

mkdir a-empty-folder
rsync -a --delete a-empty-folder/ your-target-folder/

find + xargs

find your-target-folder/ -type f -print0 | xargs -0r -P10  rm -f

This command will remove all the files in the target folder.

The key thing is we may execute it parallel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment