rsync - find - perl - Super fast delete a folder with large number of files
http://www.dxulab.com/wiki/superfastdeleteafolderwithlargenumberoffiles
posted Jul 4, 2016, 12:08 AM by Dong Xu [ updated Jul 6, 2016, 9:20 AM]
http://www.slashroot.in/which-is-the-fastest-method-to-delete-files-in-linux
=============================================== Nice article. It inspired me to check results for find -delete, rsync and perl. I got another top. On my PC leader is find. Linux 4.2, Ubuntu 14.04, Intel i5 4 cores, Intel SSD 5xx series, EncFS encryption. $ time for i in $(seq 1 500000); do echo testing >> $i.txt; done real 1m13.263s Operation was repeated for each test with similar results. $ time rsync --delete -av ../empty/ ./ real 4m5.197s $ time find ./ -delete real 2m19.819s $ time perl -e 'unlink for ( <*> ) ' You can use this. You need to use glob for removing files:
These extra apostrophes are needed to handle filenames with spaces as one string. Won't delete files with no " =========================
|