Sample Header Ad - 728x90

Zip the contents of a folder without including the folder itself

234 votes
8 answers
352240 views
I have a directory called folder that looks like this: folder -> root_folder -> some files I want to zip this directory into zipped_dir, I tried: zip -r zipped_dir.zip folder/* But this generates a ZIP that looks like this: zipped_dir -> folder -> root_folder -> some files in other words, it's including the directory whose contents I want to zip. How can I exclude this parent directory from the ZIP, without moving anything? IE I would like this end result: zipped_dir -> root_folder -> some files
Asked by Juicy (4125 rep)
Jan 30, 2015, 02:52 PM
Last activity: Oct 31, 2024, 09:07 AM