我不想创建一个没有内部目录结构的“平面”压缩包。但我希望顶级文件是“松散的”,而不是镜像它们最初所在的目录结构。
考虑:
+ archives
|
+ data
|
+ site
|
+ file1.html
|
+ subdirectory
|
+ etc...
如果我cd
进入archives
并在那里创建我的 tar,例如:tar -czf archive.tgz ../data/site/*
当我稍后提取 tarball 时,它将重新创建data/site/...
,然后我将不得不mv data/site/* ../some/other/dir
.
我希望能够tar -xzf archive.tgz -C ../some/other/dir
让例如 file1.html 就在里面../some/other/dir
。