pno*_*nom 4 tar shell-script bzip2
我正在尝试查找具有给定扩展名的所有文件,但出现此错误:
tar: Cannot update compressed archives
Try 'tar --help' or 'tar --usage' for more information.
tar: Cannot update compressed archives
Try 'tar --help' or 'tar --usage' for more information.
tar: Cannot update compressed archives
Try 'tar --help' or 'tar --usage' for more information.
tar: Cannot update compressed archives
Try 'tar --help' or 'tar --usage' for more information.
tar: Cannot update compressed archives
Try 'tar --help' or 'tar --usage' for more information.
tar: Cannot update compressed archives
Try 'tar --help' or 'tar --usage' for more information.
Run Code Online (Sandbox Code Playgroud)
这是脚本:
touch archive.tar.bz2; find . -type f \( -name '*.bak' -o -name '*.c' -o -name '~*' \) -exec tar rjvf archive.tar.bz2 {} \; -exec rm -rf {} \;
Run Code Online (Sandbox Code Playgroud)
有什么方法可以使用find更新压缩档案吗?
不,您不能使用tar
.
但是,如果您的脚本正在创建存档(使用touch
),您可以稍后更新并压缩它。更改rjvf
为rvf
,并在脚本结束时运行bzip2 archive.tar
(我从j
选项和要bzip2
用于压缩的标签中获取它)。
归档时间: |
|
查看次数: |
2902 次 |
最近记录: |