Reputation: 2629
I'm using zip
program in a bash script and i would like to create an archive containing all files in a folder without adding the folder itself to the archive.
I have such files :
script.sh
files/
files/1
files/2
I'm using this command in script.sh
zip -q -9 -r arch.zip files/*
but this creates a files
folder in the archive and i would like to get files 1
and 2
directly at the root of the archive.
How can i modify the parameters passed to zip
command to prevent it from adding files
in this archive ?
Thanks
FIXED :
Obviously, SO search engine is more efficient when the question is posted than before ...
Upvotes: 5
Views: 13777
Reputation: 51
you should use -j key. Try this way:
zip -q -9 -j arch.zip files/*
Upvotes: 5