Delete the directory under lots of small files and large files emptied

Wherein --delete-before a recipient is performed before transmitting the delete operation  
can be used to empty directory or file, as follows:  
1, to create a new directory  
mkdir / Data / blank  
2, to delete certain catalogs the rsync  
the rsync --delete-before - d / data / blank / / var   / spool / clientmqueue /
so that the target directory will soon be emptied  

and if you have some particularly large file you want to delete, such as real-time updates nohup.out such documents are easily dozens a hundred G G can also be  

to use rsync emptied large files, and more efficient  
one, creating an empty file  
Touch /data/blank.txt  
2, empty file with rsync  
rsync -a --delete-before --progress --stats /root/blank.txt /root/nohup.out  

Guess you like

Origin www.cnblogs.com/executive-1314/p/11105179.html