tar命令小解

在linux下面使用tar命令解压以及压缩文件!!!

使用tar --help可以看到如下信息。

GNU `tar' saves many files together into a single tape or disk archive, and

can restore individual files from the archive.

 

Usage: tar [OPTION]... [FILE]...

 

Examples:

  tar -cf archive.tar foo bar  # Create archive.tar from files foo and bar.

  tar -tvf archive.tar         # List all files in archive.tar verbosely.

  tar -xf archive.tar          # Extract all files from archive.tar.

……
这里简要介绍几个重要选项。
-c选项,新建一个压缩文件
-x选项,解压缩文件。
下面看到 tar -cf [file]
     tar -xf [file]
分别就是压缩文件和解压缩文件了。
除了这个,可能需要压缩其他格式文件了,
如-j/-z选项
  -j, --bzip2                        filter the archive through bzip2
  -z, --gzip, --ungzip               filter the archive through gzip
-j选项表明压缩文件的格式为bzip2,-z选项代表的是gzip选项
其余还有一些,我都还没有弄清楚具体意思,知道的帮忙补充啦!!!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值