0

unzip -d option to extract file from jar to specific directory

Without using any option we can unzip specific file to same directory structure, but -d option doesn't seem to work.

unzip someNiceOne.jar com/some/comp/some/dir/name.properties

This will unzip file 'name.properties' to 'com/some/comp/some/dir/'.

I need 'name.properties' to be under same directory level where my jar is present, but -d option doesn't seem to work. Any alternative option?.

unzip -d option help :

-d extract files into exdir

1 Answer 1

2

Using -j option should do what you need.

-j  junk paths (do not make directories)

In your case:

unzip -j someNiceOne.jar com/some/comp/some/dir/name.properties

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.