【发布时间】:2013-08-14 22:27:41
【问题描述】:
我不想创建没有内部目录结构的“平面”压缩包。但我希望顶级文件是“松散的”,而不是镜像它们最初所在的目录结构。
考虑:
+ 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 并在../some/other/dir 中包含例如file1.html。
【问题讨论】:
标签: unix tar directory-structure archive-tar