Script(s)

technology as-is

Linux : Compress entire folder to .gz or .bz2

| 0 comments

gzip / bzip2 can compress individual files. To compress entire folder structure ‘tar’ command comes to our rescue.

Compress to .gz 

tar -zcf </path/output.gz>  /sourcefolder/path

Compress to .bz2

tar -jcf </path/output.bz2> /sourcefolder/path

tar options :

-z : gzip
-c : compress
-f : filename
-j : bzip2

 

Leave a Reply

Required fields are marked *.