Skip to main content
1 of 7
pLumo
  • 23.2k
  • 2
  • 43
  • 70

You can list the contents of the zip with unzip -l, make it a bit more quiet with -qq.

Then parse the the list with e.g. grep -Po.

For example:

unzip -P "$(unzip -lqq test.zip | grep -Po '[^ ]*(?=\.zip)')" test.zip 

or if you don't have grep with -P option:

unzip -P "$(unzip -lqq test.zip | grep -o '[^ ]*$' | cut -f1 -d'.')" test.zip 
pLumo
  • 23.2k
  • 2
  • 43
  • 70