3
1
I'm using Fedora 17 and bash as my shell. I have a specific zip file, which has just one folder in it's root. I.e. upon unpacking the zip file i see the following:
> unzip myzip.zip
> ls
myzip.zip folderThatWasInsideZip
Supposing you know, that there is only 1 folder packed in the zip file, how do I find out the name of the main folder inside the zip file, without actually unpacking the zip file?
I'm looking for a one-liner, that would enable me to do something like this:
> <command> myzip.zip
folderThatWasInsideZip
I know there are ways to list all the files in the zip with less
, but that lists all the files in the subdirectories etc. I just want to know the name of the one folder. I know I'm missing something basic..
the -l option is used to list the files rather than unpack the zip file. see man unzip. – l1zard – 2012-11-14T09:18:49.137