I need to create a zip file using this command:
zip /dir/to/file/newZip /data/to/zip/data.txt
This works, but the created zip file creates
Using -j
won't work along with the -r
option.
So the work-around for it can be this:
cd path/to/parent/dir/;
zip -r complete/path/to/name.zip ./* ;
cd -;
Or in-line version
cd path/to/parent/dir/ && zip -r complete/path/to/name.zip ./* && cd -
you can direct the output to /dev/null
if you don't want the cd -
output to appear on screen