Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

PRESENTATION ON

COMPRESSION &
DECOMPRESSION
IN LINUX.

Made By :- MD. Salman & Praveen


Introduction

Compression :- It is the process in which we


decrease/compress the size of file or
directory.

Decompression :- It is the process in which


we resize the file or directory in its original
form.
Compression

There are mainly three types of


compression :-
1) Tar

2) Gzip

3) Bzip2
Decompression

There are three types of decompression


also .
They are :-
1) Tar

2) Gzip

3) Bzip2
Tar Compression
We cannot compress the directories directly from
bzip2 or gzip. So, here tar helps us to further
decompress these directories .

Commands used in tar :-


# tar –cvf (folder name+.tar) (folder name)
For e.g:- # tar –cvf /etc.tar /etc
Tar Decompression

Command used to decompress the folder or file using


tar:-

# tar –xvf (folder/file name+.tar) (folder/file name)

For e.g:- # tar –xvf /etc.tar /etc


Gzip compression
One can directly compress the files from gzip but
he/she cannot compress the folders/directories
directly from gzip . You need to compress it from
tar first.
Commands used to compress files from gzip:-
# tar –zcvf (file name+.tar.gz) (file name)
For e.g:-
# tar –zcvf /etc.tar.gz /etc.tar
Gzip Decompression

Command used to decompress gzip files using tar :-

# tar –zxvf (file/folder name+tar.gz) (filename+.tar)

For e.g:-
# tar –zxvf /etc.tar.gz /etc.tar
Bzip2 Compression
One can directly compress files using bzip2 but like
gzip if anyone wants to compress
folders/directories he/she needs to convert that into
tar first.
Command used to compress files using bzip:-
# tar –jcvf (file/folder name.tar.bzip2) (file/folder
name+.tar)
For eg:-
# tar –jcvf /etc.tar.bzip2 /etc.tar
Bzip2 Decompression
Command used to decompress bzip2 files/folders
using tar:-

#tar –jxvf (file/foldername+.tar.bz2) (file/folder


name+.tar)
For e.g :-
# tar –jxvf /etc.tar.bz2 /etc.tar
The End

You might also like