-sf
--show-files
Show the files that would be operated on, then exit. For instance, if creating a new archive, this
will list the files that would be added. If the option is negated, -sf-, output only to an open log
file. Screen display is not recommended for large lists.
---
$zip-sf test.zip
---
Archive contains:
a.txt
b.txt
Total 2 entries (0 bytes)
vim / less
没有安装 unzip时,使用 vim 打开压缩包会提示: ***error*** (zip#Browse) unzip not available on your system
sudo apt -y install zip
另外 vim 和 less 还可以查看jar 文件
$ vim test.zip
---
" zip.vim version v28
" Browsing zipfile /mnt/d/com_lib/test.zip
" Select a file with cursor and press ENTER
a.txt
b.txt
---
$ less test.zip
----
Archive: test.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
0 Stored 0 0% 2023-09-22 20:12 00000000 a.txt
0 Stored 0 0% 2023-09-22 20:12 00000000 b.txt
-------- ------- --- -------
0 0 0% 2 files
test.zip (END)
$ vim math-game.jar
----
" zip.vim version v28
" Browsing zipfile /mnt/d/com_lib/math-game.jar
" Select a file with cursor and press ENTER
META-INF/MANIFEST.MF
META-INF/
demo/
META-INF/maven/
META-INF/maven/com.taobao.arthas/
META-INF/maven/com.taobao.arthas/math-game/
arthas-git.properties
demo/MathGame.class
META-INF/maven/com.taobao.arthas/math-game/pom.xml
META-INF/maven/com.taobao.arthas/math-game/pom.properties
~
查看归档文件
tar
tar 能查看归档文件,如果是仅压缩文件是无法查看的
$ tar-tvf test.zip
---
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
---
$ tar-tvf test.tar
-rwxrwxrwx qww/qww 02023-09-22 20:12 a.txt
-rwxrwxrwx qww/qww 02023-09-22 20:12 b.txt