1

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.

  • 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
4

Use

zip file.zip *

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

2

Create file.zip:

zip file *

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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