Zip Files
Todd Slater
dontodd at gmail.com
Thu Apr 20 16:15:36 UTC 2006
On 4/20/06, Charles Malespin <ubuntu.physicist at gmail.com> wrote:
> Hi all,
> I am trying to zip some files in a dir. that I have in my home
> folder. I read the man, and I did
> zip -r /home/malespin/Space\Magnets
>
> and it said it zipped the files in there. But where did they go? I
> cant find them at all? Plus how can I zip only particular files in the
> folder without zipping all of them? I thought that
> zip -r /home/malespin/Space\Magnets *.pdf
> would work but it didnt.... Any help would be appreciated. Thanks,
> Charles
Reread the man page. You need to specify an out name.
-r Travel the directory structure recursively; for example:
zip -r foo foo
In this case, all the files and directories in foo are saved in
a zip archive named foo.zip, including files with names starting
with ".", since the recursion does not use the shell's file-name
substitution mechanism. If you wish to include only a specific
subset of the files in directory foo and its subdirectories, use
the -i option to specify the pattern of files to be included.
You should not use -r with the name ".*", since that matches
".." which will attempt to zip up the parent directory (proba‐
bly not what was intended).
-i files
Include only the specified files, as in:
zip -r foo . -i \*.c
which will include only the files that end in .c in the current
directory and its subdirectories.
Todd
More information about the ubuntu-users
mailing list