Email or username:

Password:

Forgot your password?
Stefan Eissing

Fast Unix Commands: alexsaveau.dev/blog/projects/p (via HN)

„Tar
Shockingly, collecting a directory into a tarball and then extracting it into a new directory to copy it is often faster than cp.“

Class assignment: explain why🤓

5 comments
Stephan Neuhaus

@icing my preferred way of copying a directory for ages has been

(cd source; tar cf - .) | (cd dest; tar xf -)

I can never remember how cp -r works.

Ariadne Conill 🐰

@icing cp is slow in general in most cases. with tar, file accesses are buffered, inodes are preloaded, etc. somewhat related: ariadne.space/2022/07/17/how-e

Stefan Eissing

@ariadne Nice article! Never used splice before - it shows my age.😌

Stefan Eissing

@ariadne The other advantage of tar: it uses 2 cores without interference into each other memory caches.

Andy Jones

@icing I'm afraid I always use rsync. Which probably tells you I only copy small directories (or always have another task I can be doing…)

Go Up