Re: Usage of -x
Greg Roelofs <[email protected]> Fri, 6 Feb 2004 08:07:53 -0800
| Newsgroups | gmane.comp.archivers.info-zip |
|---|---|
| Message-ID | <[email protected]> |
> I'm trying to exclude an entire directory sub-tree from a zip. It's > 400Mb and would be difficult to move out of the way. > I've tried several variations: > zip -b d: -r %1.zip %1 -x *.iso -x QNami_CDROM_Installers\* Is QNami_CDROM_Installers an immediate subdirectory of the current one? If not (likely, given the %1), you probably need the %1 in front of it (and anything else between the %1 and itself). Also, just one -x, and Win32/DOS may have other oddities of which I'm unaware. Here's approximately what I do (would do) on Unix, except using your %'s and not quoting the wildcards (usually required in Unix shells): zip -r foo.zip %1 -x *.iso %1/*/QNami_CDROM_Installers/* or zip -r foo.zip %1 -x *.iso */QNami_CDROM_Installers/* The wildcard must match the eventual names that get put into the zipfile, so no drive letters (which may be an issue with the %1), and you need to cover any extra levels of subdirs down to your target. I believe Zip also allows both forward and backslashes, but I'm not completely sure about that; what goes in the zipfile is always forward slashes. Greg