Linux Tar Command

Create linux tar gz (Gzip) archive

tar -czvf myarchive.tgz mydirectory/

We use the -c (create) option to create an linux tar archive
**Note that .tgz is the same thing as .tar.gz

Create linux simple tar archive (withouth compresion)

tar -cvf myarchive.tar mydirectory/

Extracting linux tar archive:

Extract linux tar gz (Gzip) archive


tar -xzvf mystuff.tgz

Extract linux simple tar archive


tar -xvf mystuff.tar

We use -x (extract) to extract the files form the tar archive



Extract linux tar archive to speciefied directory


tar -xvzf filename.tar.gz -C /desired/path

Testing / viewing your archive

tar -tvf myarchive.tar
tar -tzvf myarchive.tgz

Here we used the – t opton
-t, –list                           list the contents of an archive

No comments:

Post a Comment

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...