如何使用“更改目录”选项使tar遍历工作
我有followin目录结构: base/ files/ archives/ scripts/ 我想一个脚本来运行的scripts/,压缩文件,那场比赛results.*.log中files/为gzip压缩tar归档文件中archives/。 我正在尝试以下命令: tar czfC ../archives/archive.tar.gz ../files results.*.log 但是我明白了 tar: results.*.log: Cannot stat: No such file or directory tar: Exiting with failure status due to previous errors 而 tar czfC ../archives/archive.tar.gz ../files results.a.log 可以正常工作。也 tar czf ../archives/archive.tar.gz ../files/results.*.log 以我想要的方式工作,除了它files/在文件中添加了前缀并且还发出警告: tar: Removing leading `../' from member names …