Linux: Compression How-to: tar gzip bzip2 xz 7zip rar zip
This page shows you how to decompress or compress
file or directory in Linux.tar archive (.tar)“tar” is unix standard for archiving a folder. Tar makes a directory into a single file. Tar does not compress.
#tar cvf new name.tardirname
#tar cvf archive.tar file1 file2 file3
Blue- directory Black-file Here's what the option means:
gzip compression (.gz)gzip is unix standard for compressing a single file. gzip is often used together with tar.
bzip2 compression (.bz2)Alternative to gzip, for compressing a single file. File size smaller than gzip.
xz compression (.xz)Alternative to gzip, for compressing a single file. File size smaller than bzip2. xz is derived from 7-zip.
#du -h /etc [34 mb]#tar cJf /root/etcbackup.tar.xz /etc [5.7 mb]#tar cjf /root/etcbackup.tar.bzip2 /etc [7 mb]#tar czf /root/etcbackup.tar.gz /etc [8.4 mb]zip archive (.zip)ZIP (file format) is for archiving and compressing a folder or single file. Originally from Microsoft Windows world.
7-zip archive (.7z)7-zip is for archiving and compressing a folder (similar to zip). Originally from Microsoft Windows world. Compresses the best.The 7z util can decompress many formats.
rar archive (.rar .rev .r00 .r01 .r02 …)RAR (file format) is proprietary, from Windows world. Often used for pirated videos. File extension: {.rar .rev .r00 .r01 .r02 …}.
Compression File Size Comparison
|
Comments
Post a Comment