$ rsync -a --delete empty-dir/ target-dir/
This command works by rsyncing the target directory (containing the files you want to delete) with an empty directory. The '--delete' switch instructs rsync to remove files that are not present in the source directory. Since there are no files there, all the files will be deleted.
I'm not clear on why it's faster than 'find -delete', but it is.
Benchmarks here: https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html
Diff your entire server config at ScriptRock.com
0sem comentários ainda