我在bash脚本中运行了以下代码。
# See if bsdtar can recognize the file
if bsdtar -tf "$file" -q '*' &>/dev/null; then
cmd="bsdtar"
else
continue
'-q'选项是什么意思?我在bsdtar命令的帮助消息中找不到任何信息。
谢谢!
答案 0 :(得分:1)
来自bsdtar man page:
-q (--fast-read) (x and t mode only) Extract or list only the first archive entry that matches each pattern or filename operand. Exit as soon as each specified pattern or filename has been matched. By default, the archive is always read to the very end, since there can be multiple entries with the same name and, by convention, later entries overwrite earlier entries. This option is provided as a performance optimization.