zar is a zip clone with a tar-like interface.
- I often forget the
-roption in the native zip command.- I prefer a tar-like interface, but my colleagues are not familiar with tar archives, so I have to use zip archives.
- I want to know whether filenames are encoded in UTF-8.
- The fifth field of the output that
zar tvfindicates the encoding of the filename.U... UTF8A... NonUTF8(ANSI)
- The fifth field of the output that
- Are the files stored correctly in the archive?
zar --md5 -tvfshows the MD5 checksums of the files in the archivezar --sha1 -tvfshows the sha1 checksums of the files in the archivezar --sha256 -tvfshows the sha256 checksums of the files in the archive
$ zar --md5 -tvf zar-noversion-linux-amd64.zip
b52fa7c45800545279d3a8264484386b -rw-rw-rw- 694516 2021/10/23 00:28 U zar
zar cvf ARCHIVE.zip [files...]zar cvf - [files...] > ARCHIVE.ZIP
Filenames are always encoded in UTF-8.
--remove-filesremoves files from disk after they are added to the archive.-C DIRECTORYchanges the working directory
zar tvf ARCHIVE.zip [files...]zar tvf - [files...] < ARCHIVE.ZIP*
--md5shows MD5 checksums of files in the archive
zar xvf ARCHIVE.zip [files...]zar xvf - [files...] < ARCHIVE.ZIP*
- Reading the archive from STDIN is slower because ZIP stores the file list at the end, so a temporary file is needed for random access.
- By golang's "archive/zip" package.
Download the binary package from Releases and extract the executable.
Use eget installer (cross-platform)
brew install eget # Unix-like systems
# or
scoop install eget # Windows
cd (YOUR-BIN-DIRECTORY)
eget hymkor/zarUse scoop-installer (Windows only)
scoop install https://raw.githubusercontent.com/hymkor/zar/master/zar.json
or
scoop bucket add hymkor https://github.com/hymkor/scoop-bucket
scoop install zar
go install github.com/hymkor/zar@latest
Note: go install places the executable in $HOME/go/bin or $GOPATH/bin, so you need to add this directory to your $PATH to run zar.
- MIT License
