월요일, 11월 04, 2013

Linux: A faster way to delete millions of files in a directory

A faster way to delete millions of files in a directory
Source:

Conclusion: use 'rsync'

...
(The # of files is 1000000. Each of them has 0 size.)
CommandElapsedSystem Time%CPUcs1 (Vol/Invol)
rsync -a –delete empty/ a10.601.3195106/22
find b/ -type f -delete28.5114.465214849/11
find c/ -type f | xargs -L 100 rm241.6920.605437048/15074
find d/ -type f | xargs -L 100 -P 100 rm234.3227.8289929897/21720
rm -rf f31.2914.804715134/11
...


-----
Cheers,
June

댓글 없음:

댓글 쓰기