[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 5000 Folders in a directory



On Thu, 18 Feb 2016, SamuelOPH wrote:
> I'm not really sure how could I adapt your command to use '>' instead of
> touch, but shouldn't '>' be faster if using 3 processes too?

seq 0 9999 | xargs touch; creates three processes, but only one process
is doing the touching.

% time dash -c 'for i in $(seq 0 9999) ; do > $i ; done; '
dash -c 'for i in $(seq 0 9999) ; do > $i ; done; '  0.02s user 0.05s system 96% cpu 0.075 total
% time (seq 0 9999 |xargs touch);                                   
( seq 0 9999 | xargs touch; )  0.00s user 0.03s system 86% cpu 0.041 total


-- 
Don Armstrong                      http://www.donarmstrong.com

If I had a letter, sealed it in a locked vault and hid the vault
somewhere in New York. Then told you to read the letter, thats not
security, thats obscurity. If I made a letter, sealed it in a vault,
gave you the blueprints of the vault, the combinations of 1000 other
vaults, access to the best lock smiths in the world, then told you to
read the letter, and you still can't, thats security.
 -- Bruce Schneier


Reply to: