why does, for instance,
ls -1 /path/to/something/data*data/file*.txt
work fine, while something like the following returns an error:
tar -xzvf *tar.gz
tar: evsClient-v.0.0.6.tar.gz: Not found in archive
tar: evsClient-v.0.0.7.tar.gz: Not found in archive
The -f
option to tar
only expects one argument to specify the file to process. If using a glob expression as you have to tar -xzvf
and there are multiple files that get expanded as a result, the files after the first one are taken to be regular arguments to tar
, not an option argument to -f
.
Since you are using -x
, tar
is in extraction mode, and it is taking the other files to be the name of files to be extracted from the archive that it is operating on.