- User ID
- 1
- Joined
- 7 Jan 2019
- Messages
- 943
- Reaction score
- 40
- Points
- 28
To create a tar.gz archive from a given folder you can use the following command
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
This will extract the archive to the folder tar-archive-name.
To Preserve permissions:
Switch the ‘c’ flag to an ‘x’ to extract (uncompress).
Bash:
tar -zcvf tar-archive-name.tar.gz source-folder-name
To extract a tar.gz compressed archive you can use the following command
Bash:
tar -zxvf tar-archive-name.tar.gz
To Preserve permissions:
Bash:
tar -pcvzf tar-archive-name.tar.gz source-folder-name
Bash:
tar -pxvzf tar-archive-name.tar.gz