BIP KB:
Create Compress Archive Almost Any File in Linux (tar, tar.gz, tar.bz2, gz, bz, zip, 7z, rar, etc…)

Article By yang-li


img

Compress file Command's like rar, tar, unzip, zip on a VPS Server

This is a Linux command line guide/cheat sheet that will help you archive or compress file. More options are also available by reading the man pages!

Most compression or archiving methods that you may want are already built into popular distributions (Ubuntu, Fedora, Suse, etc…), but some of them aren’t.

I would recommend installing this group of packages using apt-get, yum, or an equivalent before using this guide (unless of course you already know what you need):

KB Knowledge Base - compress file - VPS server hosting at BIPmedia
su -c 'yum install unzip zip p7zip rar unrar bzip2 gzip lzma'

Command's

.tar Command

tar cvf filename.tar /dir

.tar.gz

tar czvf filename.tar.gz /dir

.tgz

tar cvzf filename.tgz /dir

.tar.gz2

You probably mean .tar.bz2

.tar.bz

tar cjvf filename.tar.bz /dir

.tbz

tar cjvf filename.tbz /dir

.tar.bz2

tar cjvf filename.tar.bz2 /dir

.tar.Z .Z is an old naming convention which has moved to .gz. See .tar.gz above. .tar.xz

tar cvf -  filenames | lzma > filename.tar.xz 

.gz

gzip filename

.bz

bzip filenameCreate Compress Archive

.bz2

bzip2 filename

.xz

lzma filename

.zip

zip -r filename.zip /dir

.7z

7z a -t7z filename.7z /dir

.rar

rar a filename.rar /dir

.dd Create these image files using:

dd if=inputfile.dd of=outputfile.dd


Have more to share? I would love to hear about it in the comments section below. Also, If you're having any trouble, let me know about it in the comments. We’ll get you straightened out.




Tags: , , , , , , , , , , , ,

Spin up a VPS server in no time flat

Simple setup. Full root access. Straightforward pricing.

DEPLOY VPS SERVER

Leave a Reply



Feedbacks

Spark Book Company

Posted on June 5, 2018

Test


Amitabh Singh

Posted on June 5, 2018

This is the first tutorial feedback test.