Forum Moderators: bakedjake

Message Too Old, No Replies

Zip command

Using it to "save as"

         

adni18

2:25 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, I'm experimenting a bit with the "zip" command in Linux, and I can't seem to figure out how to archive a folder in a custom location. For example, I might want to archive gallery/Users/user30/ in temp/blablabla.zip.

How would one do this?

mcavic

3:25 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try it like this:

cd /home/joe
zip -r /tmp/blah.zip gallery

The -r causes it to recursively include all the files in all the subdirectories.

You can also do
zip -r /tmp/blah.zip /home/joe/gallery

In the first example, "gallery" will be the parent directory in the zip file. In the second example, "home" will be the parent.