Every Linux user is familiar with file copy command, cp (copy). As an user who uses this frequently in a day, I can't help but wonder about possible alternatives to cp. CP is terrible when copying large number of files that are small in size. So, after digging in the internet, I found the following command to be a little more faster than cp command when it comes to copying smaller files.
tar cf - dir1 | (cd dir2; tar xf -)
With this, you can move an entire directory from dir1 to dir2. Here's an example.
tar cf - images/ | (cd /media/gentoo_/images/ tar xf -)
Also works with scp:
ReplyDeletetar -cf - images/ | ssh hostname tar -xf - -C /some/path
Seems it should... This one is really useful.
Delete