unzip -l file.zip/sub_file.zip
doesn't work because file.zip
isn't a directory: it's a regular file that happens to be in an archive format. But you can create a directory that mirrors the content of the zip file, by mounting a filesystem that presents a view of the content of the zip file. There are several choices, pick whichever is easiest to install on your distribution:
For example, with archivemount:
mkdir file.d
archivemount file.zip file.d
unzip -l file.d/sub_file.zip
fusermount -u file.d
or even
mkdir file.d sub_file.d
archivemount file.zip file.d
archivemount file.d/sub_file.zip sub_file.d
ls -lR sub_file.d
fusermount -u sub_file.d
fusermount -u file.d
See Extract only a specific file from a zipped archive to a given directory, How do I recursively grep through compressed archives? and Search for files with a specific size inside recursive zipped archives for examples of AVFS and fuse-zip in similar situations.
:
symbol used to refer to zip file relationship only, or have other usages? – Zen Aug 18 '14 at 02:56zipinfo: cannot find or open 2014-08-16.zip:info_2014-08-16.zip, 2014-08-16.zip:info_2014-08-16.zip.zip or 2014-08-16.zip:info_2014-08-16.zip.ZIP
– Zen Aug 18 '14 at 02:583145521 08-17-2014 00:47 info_2014-08-16.zip 1047822 08-17-2014 00:47 pay_2014-08-16.zip 46524282 08-17-2014 00:48 spend_2014-08-16.zip`
– Zen Aug 18 '14 at 02:59:
is used to accede files in archives supported bylesspipe
, recursively. If you get such errors, it seems that you are not using Wolfgang Friebel'slesspipe
. – vinc17 Aug 18 '14 at 02:59lesspipe
program first, right? But that's not a good universal solution, I think. – Zen Aug 18 '14 at 03:03lesspipe
is so useful that it should be universal. I can't live without it: used withless
(for which it has been written), it's the universal viewer in a text terminal. – vinc17 Aug 18 '14 at 03:06less
is an inside build program on Ubuntu, I can use it without installing anything, but is thisless
command the same thing withlesspipe
? If they are the same thing, why myless file.zip:sub_file.zip
doesn't work? – Zen Aug 18 '14 at 03:21less
:lesspipe
is an input preprocessor, used with theLESSOPEN
environment variable, e.g.export LESSOPEN="|/path/to/lesspipe %s"
. See theless(1)
man page for more information. – vinc17 Aug 18 '14 at 08:44lesspipe
but I am not sure about Wolfgang... I need to check. In the meantime, screw my answer. – mikeserv Aug 19 '14 at 00:28.gz
, etc.), with.deb
files, and so on. Internally temp files (or pipes) are used, but this is transparent. If thelesspipe
script doesn't contain the text "Wolfgang Friebel", you don't have the right one. – vinc17 Aug 19 '14 at 00:41