5

I have a folder structure like this:

- project:
-- folder 01:
--- file1.cpp
--- file2.cpp
-- folder 02:
--- file1.cpp
--- file2.cpp

I want to zip the content of the project folder in a way I get(when i unzip) this structure:

- folder 01:
-- file1.cpp
-- file2.cpp
- folder 02:
-- file1.cpp
-- file2.cpp

My Problem is now that I always get a parent folder with the same name as my zip file which contains folder 01 and 02. Is there a way I can zip without getting this parent folder ?

IIIIIIIIIIIIIIIIIIIIII
  • 3,958
  • 5
  • 45
  • 70
  • Have a look at this http://unix.stackexchange.com/questions/182032/zip-the-contents-of-a-folder-without-including-the-folder-itself – Dave Nov 16 '15 at 07:46
  • http://stackoverflow.com/questions/9710141/create-zip-ignore-directory-structure – Dave Nov 16 '15 at 07:46

1 Answers1

2

zip -r foo ./

assuming **

./

** i.e., present working directory is project in your case.

-r for recursively zipping

foo is the name of your zip file, i.e., foo.zip is the final zipped product you want.

shanu khera
  • 170
  • 1
  • 12