码迷,mamicode.com
首页 > 其他好文 > 详细

tar命令

时间:2018-07-08 22:05:29      阅读:188      评论:0      收藏:0      [点我收藏+]

标签:压缩   director   bz2   att   需要   info   cal   微软   sse   

tar 打包 

  tar命令的常用选项:

    打包的常用命令组合:zcvf

    解包的常用命令组合:zxvf或者xf

    查看压缩包内容的组合:tf

-z, –gzip 
  filter the archive through gzip 
  调用gzip来压缩归档文件,此时文件名最好为*.tar.gz

-j,–bzip2 
  filter archive through bzip2 
  调用bzip2来压缩归档文件,此时文件名最好为*.tar.bz2

-c, –create 
  create a new archive 
  创建新的归档文件

-v, –verbose 
  verbosely list files processed 
  在压缩/解压缩的过程中,将正在处理的文件名显示出来

-f, –file=ARCHIVE 
  use archive file or device ARCHIVE

 –exclude  排除   如果有多个需要排除的文件,可写成一个文件列表。 

  用X参数指定文件列表的形式排除不需要处理的文件或目录。-C,directory DIR 
  change to directory DIR 指定目录进行操作,如解压到指定目录。

-z,–gzip 

  • 通过gzip的支持进行解压缩

 

-j,–bzip2 
  通过bzip2的支持进行解压缩

 

-x,–extract,–get 
  xtract files from an archive 从归档文件中解出文件 。解打包或解压缩功能。

 

-C,–directory DIR 
  change to directory DIR 指定目录进行操作,如解压到指定目录

 

–exclude PATTERN 
  exclude files based upon PATTERN 排除不需要处理的文件或目录

 

-X,–exclude-from FILE 
  exclude files listed in FILE 
  指定文件列表的形式排除不需要处理的文件或目录

 

-t, –list 
  list the contents of an archive 
  查看压缩包的内容列表

-f, –file=ARCHIVE 
  use archive file or device ARCHIVE

 

 

补充:

-p, –preserve-permissions, –same-permissions 
  extract information about file permissions 
  保持文件属性

-P, –absolute-names 
  don’t strip leading ‘/’s from file names 
  打包带上”/”(很危险不要用)

tar命令

标签:压缩   director   bz2   att   需要   info   cal   微软   sse   

原文地址:https://www.cnblogs.com/alesic/p/9281312.html

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