Linux 中tar命令 打包、解包到指定目录

 

001、打包只指定目录

[root@pc1 test]# ls
a.txt  b.map  c.ped  dir1
[root@pc1 test]# ls dir1/
[root@pc1 test]# tar -cf ./dir1/xx.tar a.txt b.map c.ped    ## 打包至指定的目录
[root@pc1 test]# ls
a.txt  b.map  c.ped  dir1
[root@pc1 test]# ls dir1/
xx.tar

 

002、解包至指定的目录

[root@pc1 test]# ls
a.txt  b.map  c.ped  dir1  xx.tar
[root@pc1 test]# ls dir1/
[root@pc1 test]# tar -xf xx.tar -C ./dir1/    ## 解包至指定目录
[root@pc1 test]# ls dir1/
a.txt  b.map  c.ped

 。

 

posted @   小鲨鱼2018  阅读(1578)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2022-10-31 >chr1 <_io.TextIOWrapper name='result.fa' mode='w' encoding='UTF-8'>
2022-10-31 python 中实现将两个列表合并为字典
2022-10-31 linux 中实现文本的按列反转
2021-10-31 R语言中矩阵运算
2021-10-31 R语言实现计算两个向量的协方差、标准差、皮尔逊相关系数
2021-10-31 R语言统计 plink格式数据样本缺失率
2021-10-31 linux shell 统计plink格式样本缺失率
点击右上角即可分享
微信分享提示