Never having given it much thought before, I wanted to know of a way to add a comment to my zip files in Linux. I used to do this sort of thing many years back with pkzip in the DOS days. There turns out to be nice little utility, called zipnote.
To check for comments in a zipfile. The command is simple “zipnote zipfile.zip”
[root@server1 check]# zipnote check_ssl_cert-master @ check_ssl_cert-master/ @ (comment above this line) @ check_ssl_cert-master/.gitmodules @ (comment above this line) @ check_ssl_cert-master/.travis.yml @ (comment above this line) @ check_ssl_cert-master/AUTHORS @ (comment above this line) @ check_ssl_cert-master/COPYING @ (comment above this line) @ check_ssl_cert-master/COPYRIGHT @ (comment above this line) @ check_ssl_cert-master/ChangeLog @ (comment above this line) @ check_ssl_cert-master/INSTALL @ (comment above this line) @ check_ssl_cert-master/Makefile @ (comment above this line) @ check_ssl_cert-master/NEWS @ (comment above this line) @ check_ssl_cert-master/README.md @ (comment above this line) @ check_ssl_cert-master/TODO @ (comment above this line) @ check_ssl_cert-master/VERSION @ (comment above this line) @ check_ssl_cert-master/check_ssl_cert @ (comment above this line) @ check_ssl_cert-master/check_ssl_cert.1 @ (comment above this line) @ check_ssl_cert-master/check_ssl_cert.spec @ (comment above this line) @ check_ssl_cert-master/shell-ci-build/ @ (comment above this line) @ check_ssl_cert-master/shell-ci-build.sh @ (comment above this line) @ check_ssl_cert-master/test/ @ (comment above this line) @ check_ssl_cert-master/test/cabundle.crt @ (comment above this line) @ check_ssl_cert-master/test/cacert.crt @ (comment above this line) @ check_ssl_cert-master/test/unit_tests.sh @ (comment above this line) @ (zip file comment below this line) 621f56ac2326a8378edd3bad510a06167f9a5988
To list files files with the unzip.
unzip -l zipfiles.zip
To add comments to the zip file, extract a list to a text file, modify the the text file, and import the comments into the zip file.
# Extract file list with comments zipnote zipfiles.zip > textfile.txt
Add some comments wherever desired between the “@” and (comment above this line).
@ check_ssl_cert-master/ My comment is here! Hello World. @ (comment above this line) @ check_ssl_cert-master/.gitmodules
Save the textfile and import/write back into the zip file with zipnote.
zipnote -w zipfiles.zip < textfile.txt
Here are a couple of commands to verify the comments.
zipnote zipfiles.zip unzip -l zipfiles.zip
Source(s)