0

I ran across the following code in a bash script.

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

what did the '-q' option mean? I did not find any information in the help message of bsdtar command.

Thank you!

hek2mgl
  • 152,036
  • 28
  • 249
  • 266
yorua007
  • 803
  • 3
  • 9
  • 14

1 Answers1

1

From the 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.
hek2mgl
  • 152,036
  • 28
  • 249
  • 266