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
。