【Linux】tar 命令

1 options

1.1 -f

–file = archive-name
-f archive-name
this option determines the name of the archive file that tar will work on.
指定要操作的tar文件

1.2 -v

-verbose
-v
shows details about the results of running tar. This can be especially useful
when the results might not be obvious.
显示tar运行的过程。为用户展现工作过程避免用户错误终止该程序。

1.3 -t

–list
-t
显示archive file中的文件
tar -tf vf.tar
tar -tvf vf.tar 显示详细信息(ls -l)

1.4 -x

–extract
-x
uncompress 解压缩。
tar -xvf vf.tar

1.5 -r

–append
-r
向archive file中添加文件
tar -rf vf.tar exp.cpp %将exp.cpp添加到vf.tar中

1.6 -A

–concatenate
-A
将一个tar文件内容复制到另一个压缩文件中去。
tar -Af vf.tar a.tar %将a.tar中内容拷贝到vf.tar中

2 解压指定文件

tar -xvf vf.tar vf %其中vf是vf.tar中的一个文件夹
tar -xvf vf.tar vf.cpp %其中vf.cpp是vf.tar中的一个文件
tar -xvf vf.tar vf/vf/Debug %只解压vf/vf/Debug

Author: visayafan <visayafan@gmail.com>

Date: 2011-11-26 16:37:01

HTML generated by org-mode 6.33x in emacs 23

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值