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