I have the following file structure:
cwd/
---dir1
---file_name1
---some_file_name
---dir2
---file_name1
---some_other_file_name
---some_file
I want to get zip file such that when I unzip I get cwd
directory and NOT pwd
directory. So according to the man I need to use -j
flag. But when I use him in this case (OS X mac unix) I got error regarding the issue I have in 2 different directories same file name (file_name1
in the example).
zip error: Invalid command arguments (cannot repeat names in zip file).
first full name...
second full name...
this my be a result of using -j
According to this it seems nothing can be done and this is how zip -j
works.
How can I still achieve the requirement of compressing the zip without the default pwd
file structure? (I cannot rename the files - there is a reason why from the beginning I use zip via shell etc...).
Thanks,