Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zipping without creating parent folder

Tags:

linux

zip

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 ?

like image 255
IIIIIIIIIIIIIIIIIIIIII Avatar asked Nov 21 '22 23:11

IIIIIIIIIIIIIIIIIIIIII


1 Answers

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.

like image 103
shanu khera Avatar answered Nov 23 '22 12:11

shanu khera