Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interesting usage of tar... but what is happening?

Tags:

People also ask

Why is tar still used?

Wood tar is still used to seal traditional wooden boats and the roofs of historic, shingle-roofed churches, as well as painting exterior walls of log buildings. Tar is also a general disinfectant.

What is an advantage of using tar over zip?

By breaking the file data up into small chunks and compressing them separately, it allows you to extract specific files or parts of files without having to decompress everything in the archive before it.

Does tar keep original?

By default when we add files to an archive file the original files will remain on the file system. We can optionally remove the original files after adding them to the tar file with the --remove-files option. While this will delete the original files from the file system, they will exist within the tar file.


I saw the following interesting usage of tar in a co-worker's Bash scripts:

`tar cf - * | (cd <dest> ; tar xf - )`

Apparently it works much like rsync -av does, but faster. The question arises, how?

-m


EDIT: Can anyone explain why should this solution be preferable over the following?

cp -rfp * dest

Is the former faster?