IIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIII

Reputation: 4088

Zipping without creating parent folder

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 ?

Upvotes: 6

Views: 6617

Answers (1)

shanu khera
shanu khera

Reputation: 158

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.

Upvotes: 2

Related Questions