【问题标题】:The -q option of bsdtarbsdtar 的 -q 选项
【发布时间】:2013-04-10 14:10:01
【问题描述】:

我在 bash 脚本中遇到了以下代码。

# See if bsdtar can recognize the file
if bsdtar -tf "$file" -q '*' &>/dev/null; then
   cmd="bsdtar"
else
continue

'-q' 选项是什么意思?我在 bsdtar 命令的帮助信息中没有找到任何信息。

谢谢!

【问题讨论】:

    标签: bash bsdtar


    【解决方案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.
    

    【讨论】:

      猜你喜欢
      • 2021-09-26
      • 2021-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多