Posted in linux
145
2:41 am, May 26, 2020

tar.gz to compress a directory in linux and then decompress it

a pretty common way to zip up contents in a directory into one (or technically two) archive(s).

Add to tar.gz

This will add the directory and all sub directories into the archive called the-archive-name.tar.gz from the directory the-directory you can add a full path to this if needed.

tar -zcvf the-archive-name.tar.gz the-directory

Un Compressing

This is the code to restore the files from the archive. This one will extract it to the current directory.

tar -zxvf the-archive-name.tar.gz

You can also add a target directory to uncompress to like the following

tar -zxvf the-archive-name.tar.gz my-target-directory

tar.gz to compress a directory in linux and then decompress it Demo

View Demo Full Screen View Demo New Tab

tar.gz to compress a directory in linux and then decompress it Code

Related Tags

No Items Found.

Add Comment
Type in a Nick Name here
 
Related Search Terms