[关闭]
@blackwang 2016-04-14T23:42:24.000000Z 字数 934 阅读 1383

Linux下的打包,解压缩命令

Linux 打包


gzip压缩,gunzip解压缩,

bzip2,bunzip(与gzip十分类似,但压缩率较gzip高)

xz

这三个的命令基本上时一样的,记住一个即可


zip,unzip

  1. zip test.zip test # 压缩test
  2. zip -r test.zip test1.md text2 # 递归压缩test1.md文件和test2目录到test.zip文件
  3. unzip test.zip -d /tmp # 解压缩文件到指定目录

tar 打包压缩

  1. tar -cvf test.tar test text1.txt # 把test目录和text文件打包,不压缩
  2. tar -zcvf test.tar.gz test # 打包后用gzip压缩
  3. tar -jcvf test.tar.bz2 test # 打包后用bzip2压缩
  4. tar -xvf test.tar
  5. tar -xvf test.tar.gz
  6. tar -xjvf test.tar.bz2
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注