Zip -j command, what does the -j option mean?

I wonder what the -j option means in the zip command. I found an explanation as follows:

 -j Store just the name of a saved file (junk the path), and do not store directory names. By default, zip will store the full path (relative to the current path). 

But not quite sure what that means? Can someone explain this using the following command as an example?

 C:\programs\zip -j myzipfile file1 file2 file3 

Thanks.

+4
source share
3 answers

This will make sense in another example:

 C:\programs\zip myzipfile a/file1 b/file2 c/file3 

Usually this will result in a zip containing three sub-tears:

 a/ + file1 b/ + file2 c/ + file3 

With -j you get:

 ./ + file1 + file2 + file3 
+6
source

in this case, he will not do anything special.

but if, for example, you print

 C:\programs\zip -j myzipfile directory1 

and directory1 contain subdirectories, all files that you archive when extracted will be placed in the same directory, regardless of which subdirectory they were originally in.

+1
source

-j " J unk pathnames"

-2
source

Source: https://habr.com/ru/post/1310035/


All Articles