How to Copy Directories Using Tar

To copy all files from /usr/local/source to /usr/local/destination, there are several options.

Tar
cd /usr/local/source
tar -cvf - . | (cd /usr/local/destination; tar -xvf -)

This method uses tar, but rather than create a file, it writes to a stream "-" in std output. The stream is piped to another tar command, after changing to another directory.

cp -a

cp -a /usr/local/src/* /usr/local/destination

Other options:

cpio

dd

Comments

Popular posts from this blog

Ping Multiple Hosts Using Bash Nmap and Fping

How to Obtain Bitcoin and Other Cryptocurrencies

Using nmap to Generate Host Lists