gzip
and gunzip
Command
- to zip a file
1 2
Syntax: <br/> gzip <file_name>
- to unzip a file
1 2 3 4
Syntax: <br/> gunzip <file_name> OR gzip -d <file_name>
tar
Command
- To convert an entire directory into an archive file.
- different options available in with tar are:-
c
: compressf
: filex
: extractt
: list the content of archive1 2 3 4
Syntax: <br/> tar cvf <filename>.tar file_path/folder_path Output: This creates an archive file with extension `.tar`
Tar file is then compressed using gzip with extension
filename.tar.gz
- To decompress and unzip a tar file
1 2
Syntax: <br/> tar xvf <name.tar.gz>
tar and zip at the same time
1
2
3
4
Syntax: <br/>
tar -zcvf <filename>.tar.gz file_path
And
tar -zxvf <filename>.tar.gz