• Most COVID-19 rules have ended in New Zealand.
    • You must still isolate for 7 days if you have COVID-19.
    • You must wear a face mask in healthcare facilities, such as hospitals. International travellers will not need proof of COVID-19 vaccination.
    From 13 September 2022, to enter New Zealand, you do not need proof of vaccination.

Create and extract a .tar.gz archive using command line

Andy

Administrator
Creative Team
User ID
1
Joined
7 Jan 2019
Messages
771
Reaction score
32
Points
28
To create a tar.gz archive from a given folder you can use the following command
Bash:
tar -zcvf tar-archive-name.tar.gz source-folder-name
This will compress the contents of source-folder-name to a tar.gz archive named tar-archive-name.tar.gz
To extract a tar.gz compressed archive you can use the following command
Bash:
tar -zxvf tar-archive-name.tar.gz
This will extract the archive to the folder tar-archive-name.

To Preserve permissions:
Bash:
tar -pcvzf tar-archive-name.tar.gz source-folder-name
Switch the ‘c’ flag to an ‘x’ to extract (uncompress).
Bash:
tar -pxvzf tar-archive-name.tar.gz
 
 Short URL:
Top