Citat:
Ursprungligen postat av
S Nubben
Är det extremt många filer i en katalog så kan kommandoraden bli för lång när *.zip expanderas. Använd xargs för att gå runt detta:
Kod:
find /katalog/med/zipfiler -name "*.zip" -print0 | xargs -0 unzip
...vilket väl var varför inlägg #3 såg till att escapea asterisken så att zip självt, snarare än skalet, gjorde expanderingen.
Kod:
ARGUMENTS
file[.zip]
Path of the ZIP archive(s). If the file specification is a wildcard, each matching
file is processed in an order determined by the operating system (or file system).
Only the filename can be a wildcard; the path itself cannot. Wildcard expressions
are similar to those supported in commonly used Unix shells (sh, ksh, csh) and may
contain:
* matches a sequence of 0 or more characters
? matches exactly 1 character
[...] matches any single character found inside the brackets; ranges are specified
by a beginning character, a hyphen, and an ending character. If an exclama‐
tion point or a caret (`!' or `^') follows the left bracket, then the range
of characters within the brackets is complemented (that is, anything except
the characters inside the brackets is considered a match). To specify a ver‐
batim left bracket, the three-character sequence ``[[]'' has to be used.
Rätt ovanlig funktionalitet, men unzip verkar ha den. En funktion påtvingad av avsaknaden av shell expansion i Windows, antar jag.