码迷,mamicode.com
首页 > 系统相关 > 详细

Linux Compress & Uncompress, Package & Unpackage

时间:2020-06-16 20:25:00      阅读:56      评论:0      收藏:0      [点我收藏+]

标签:com   comm   bz2   str   recommend   erb   strong   esc   --   

Common Compress Formation
.zip .gz .bz2 .tar .tar.gz .tar.gz2

// zip [option] descName srcFile/srcName   
// -r  means path
zip test.zip abc.html

zip test2.zip abc.html abcd.html


// unzip [option] compressedFile
// -d means path
unzip aaa.zip

gzip (.gz "compress but not package")

// compress
gzip -c abc.html > abc.gz  // if you just use "gzip abc.html" then the original file will gone

// uncompress
gzip -d abc.html

bzip2 (.bz2 "compress but not package")

// compress
bzip2 -k abc.html // if you just use "bzip2 abc.html" then the original file will gone

// uncompress
bzip2 -d abc.html

tar (.tar "package but not compress")

// tar [option] [-f packageName.tar] srcFile/srcDirectory
// -c package  -v verbose

//package
tar -cvf abc.tar abc.html abcd.html bcd.html

//unpackage
tar -xvf abc.tar

tar (.tar.gz & .tar.bz2 "compress and package")

/*-z    compress and uncompress .tar.gz file */
/*-j     compress and uncompress .tar.bz2 file */

// compress and package of .tar.gz
tar -zcvf abc.tar.gz abc.html abcd.html bcd.html // output : abc.tar.gz
//unpackage and uncompress of .tar.gz
tar -zxvf abc.tar.gz

// compress and package of .tar.bz2
tar -jcvf abc.tar.bz2 abc.html abcd.html bcd.html // output : abc.tar.bz2
//unpackage and uncompress of .tar.bz2
tar -jxvf abc.tar.bz2

Linux Compress & Uncompress, Package & Unpackage

标签:com   comm   bz2   str   recommend   erb   strong   esc   --   

原文地址:https://www.cnblogs.com/nedrain/p/13143959.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!