我有这个文件结构:
tree .
.
├── AAA
│ ├── a1.txt
│ ├── a2.txt
│ └── a3.txt
├── AAA.tar.gz
├── BBB
│ ├── b1.txt
│ ├── b2.txt
│ └── b3.txt
├── BBB.tar.gz
├── CCC
│ ├── c1.txt
│ ├── c2.txt
│ └── c3.txt
├── CCC.tar.gz
└── tar_test.tar.gz
列表存档正确显示:
tar tf tar_test.tar.gz
AAA.tar.gz
BBB.tar.gz
CCC.tar.gz
但是我尝试列出内部档案失败了......
tar xfO tar_test.tar.gz | tar ztf -
AAA/
AAA/a1.txt
AAA/a3.txt
AAA/a2.txt
我需要改变什么才能拥有:
tar [magic1] tar_test.tar.gz | tar [magic2]
AAA/
AAA/a1.txt
AAA/a3.txt
AAA/a2.txt
BBB/
BBB/b1.txt
BBB/b3.txt
BBB/b2.txt
CCC/
CCC/b1.txt
CCC/b3.txt
CCC/b2.txt
谢谢!