???????????

?????????????????????????????????μ?????????????????????????http://www.quora.com/How-can-someone-rapidly-delete-400-000-files???Zhenyu Lee??

????????????find ?? xargs???????д??????????rsync???????????rsync –delete?????????????????????????滻?????????????????????????????????????????Lee???????????????????????????????

??????????

?????? CPU??Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz
?????? MEM??4G
?????? HD??ST3250318AS??250G/7200RPM

??????? –delete ?? –exclude?????????????????????????????????????????????????????????????????????????????????????

???????2???

???????????Keith-Winstein????Quora????????????????????????????????????????????????á????????£???Щ????????????????????????????????????????????????п???????Щ?????????????????????Щ?????????????ū?????μ??????????????????Ρ?????????/usr/bin/time???????????????????????????μ?????

????????ζ???1000000??????????????????????0????

?????????

# method 1
~/test $ /usr/bin/time -v  rsync -a --delete empty/ a/
        Command being timed: "rsync -a --delete empty/ a/"
        User time (seconds): 1.31
        System time (seconds): 10.60
        Percent of CPU this job got: 95%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:12.42
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 0
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 24378
        Voluntary context switches: 106
        Involuntary context switches: 22
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0

# method 2
        Command being timed: "find b/ -type f -delete"
        User time (seconds): 0.41
        System time (seconds): 14.46
        Percent of CPU this job got: 52%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:28.51
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 0
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 11749
        Voluntary context switches: 14849
        Involuntary context switches: 11
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0