Assuming you don't have many thousands of files (this would generate an "Argument list too long" error), then you may do it like this with the zsh
shell:
mycli ./*.zip(P:--file:)
Or, from the bash
shell:
zsh -c 'exec mycli ./*.zip(P:--file:)'
(I'm using exec
here to replace the zsh
shell with the mycli
process, for a bit of efficiency.)
The P
filename globbing qualifier prepends the given string (here, --file
) as a separate word before each element that the glob expands to.
To include hidden files, add D
before P
, and to limit the matching to only regular files, add .
:
zsh -c 'exec mycli ./*.zip(.DP:--file:)'
For a recursive globbing down into subdirectories:
zsh -c 'exec mycli ./**/*.zip(.DP:--file:)'
... and to order the files in order of modification timestamp (would you want to do so), add om
as you added D
and .
before.