Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Using the zip command, how do I add all files in the current directory to a zip file without including the folder?

For instance, when I unzip, I want all the files to dump out, not get put into a new folder.

I tried

zip * file.zip

But could not locate the zip file after it was done.

share|improve this question
    
You should edit this to include what OS you're doing this on. Also, remove the SSH - it has nothing to do with your question. –  mfinni Sep 28 '10 at 13:50
    
Also FYI - on any Unix-like system (including Linux), if you type "man command-name", you can get the man page (manual) for the command. "man zip" would answer this for you. Not to say you shouldn't ask questions here, but you can get the easy answers fastest from the system itself and you'll learn a lot, too. –  mfinni Sep 28 '10 at 14:23
    
In general, if you don't know how to use a command, type command --help or man command. In this case zip --help or man zip. Man as in manual. –  Znarkus Sep 28 '10 at 14:24

2 Answers 2

up vote 4 down vote accepted

Use

zip file.zip *

Notice how the arguments are backwards compared to your original example.

share|improve this answer

Create file.zip:

zip file *
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.