How to tar multiple Directories

Very simply, if you want to create a single tar file on a linux host consisting of multiple directories, you could use the following command:

tar czfP <filename>.tgz <directory1> <directory2> … <directoryn>

To untar the file. move the file to the correct directory and cd to that directory. Then Run:

tar xvf tarfile.tgz
Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Solve : *
22 − 18 =