10
1
For recursively copying a directory, using tar
to pack up a directory and then piping the output to another tar
to unpack seems to be much faster than using cp -r
(or cp -a
).
Why is this? And why can't cp
be made faster by doing it the same way under the hood?
Edit: I noticed this difference when trying to copy a huge directory structure containing tens of thousands of files and folders, deeply nested, but totalling only about 50MB. Not sure if that's relevant.
That's one interesting question. You can find some answers here: http://stackoverflow.com/questions/316078/ and here: http://unix.stackexchange.com/questions/66647/
– Teresa e Junior – 2014-07-26T19:00:44.510