BSDUNZIP(1)
π BSDUNZIP(1) π
okay bestie, so bsdunzip is a General Commands Manual page, and it's literally the moment you finally get your files OUT of a ZIP archive. extraction era. let's go π¦
β¨ NAME β¨
bsdunzip β extract files from a ZIP archive π
β¨ SYNOPSIS β¨
bsdunzip [-aCcfjLlnopqtuvy] [{ -O | -I } encoding] [-d dir] [-x pattern]
[-P password] zipfile [member ...]
β¨ DESCRIPTION β¨
so here's the whole vibe β these are the options available, and no cap, every single one matters π
-aβ when you're extracting a text file, this converts DOS-style line endings into Unix-style line endings. glow-up for your line breaks β¨-Cβ matches file names case-insensitively. soREADMEandreadmeare the same girl fr fr.-cβ extract to stdout/screen. when extracting files from the zipfile, they get written to stdout. this is similar to-p, but it does not suppress normal output.-ddir β extract files into the specified directory instead of the current directory. pick your destination, main character π-fβ Update existing. extract a file from the zipfile only if a file with the same name already exists on disk and is older than the former. otherwise, the file is silently skipped. lowkey rude but okay π-Iencoding-Oencoding β convert filenames from the specified encoding.-jβ ignore directories stored in the zipfile; instead, extract all files directly into the extraction directory. no folders, no structure, just files, chaos era π-Lβ convert the names of the extracted files and directories to lowercase.-lβ List, rather than extract, the contents of the zipfile. look, don't touch π-nβ No overwrite. when extracting a file from the zipfile, if a file with the same name already exists on disk, the file is silently skipped.-oβ Overwrite. when extracting a file from the zipfile, if a file with the same name already exists on disk, the existing file is replaced with the file from the zipfile. periodt, out with the old π₯-pβ Extract to stdout. when extracting files from the zipfile, they are written to stdout. the normal output is suppressed as if-qwas specified.-Ppassword β extract encrypted files using a password.
β οΈ putting a password on the command line using this option can be insecure. bestie. i'm begging you. be careful π
-qβ Quiet: print less information while extracting.-tβ Test: do not extract anything, but verify the checksum of every file in the archive. trust but verify, iconique π§-uβ Update. when extracting a file from the zipfile, if a file with the same name already exists on disk, the existing file is replaced with the file from the zipfile if and only if the latter is newer than the former. otherwise, the file is silently skipped.-vβ List verbosely, rather than extract, the contents of the zipfile. this differs from-lby using the long listing. note that most of the data is currently fake and does not reflect the content of the archive. fake it till you make it, i guess π-xpattern β exclude files matching the pattern pattern. (yes bestie, that's genuinely what it says, i'm not even joking π)-yβ print four digit years in listings instead of two.2023not23, we're doing full lore now ποΈ-Zmode β emulatezipinfo(1L)mode. enablingzipinfo(1L)mode changes the way in which additional arguments are parsed. currently onlyzipinfo(1L)mode1is supported, which lists the file names one per line.[member ...]β optional list of members to extract from the zipfile. can include patterns, e.g.,'memberdir/*'will extract all files and dirs belowmemberdir. β¨
π¨ big important note bestie: only one of-n,-o, and-umay be specified. if the specified filename is-, then data is read from stdin.
β¨ ENVIRONMENT β¨
if the UNZIP_DEBUG environment variable is defined, the -q command-line option has no effect, and additional debugging information will be printed to stderr. she's nosy and she's not sorry π
β¨ COMPATIBILITY β¨
the bsdunzip utility aims to be sufficiently compatible with other implementations to serve as a drop-in replacement in the context of the ports(7) system. no attempt has been made to replicate functionality which is not required for that purpose. slay, focused, on brand π
for compatibility reasons, command-line options will be recognized if they are listed not only before but also after the name of the zipfile. flexible queen π
normally, the -a option should only affect files which are marked as text files in the zipfile's central directory. since the libarchive(3) library does not provide access to that information, it is not available to the bsdunzip utility. instead, the bsdunzip utility will assume that a file is a text file if no non-ASCII characters are present within the first block of data decompressed for that file. if non-ASCII characters appear in subsequent blocks of data, a warning will be issued. β οΈ
the bsdunzip utility is only able to process ZIP archives handled by libarchive(3). depending on the installed version of libarchive(3), this may or may not include self-extracting or ZIPX archives. it's giving "depends on your setup" π¦
β¨ SEE ALSO β¨
β¨ HISTORY β¨
the bsdunzip utility appeared in FreeBSD 8.0. vintage. iconic. a classic π
β¨ AUTHORS β¨
the bsdunzip utility and this manual page were written by Dag-Erling SmΓΈrgrav <des@FreeBSD.org>. it uses the libarchive(3) library developed by Tim Kientzle <kientzle@FreeBSD.org>.
absolute legends, both of them π«Ά
β¨ CAVEATS β¨
π listen up, this one's a trap:
the bsdunzip utility performs two scans of the command-line for arguments before and after the archive name, so as to maintain compatibility with Info-ZIP unzip. as a result, the POSIX β--β double-dash string used to separate options from arguments will need to be repeated.
for example, to extract a -a.jpg from -b.zip with overwrite, one would need to invoke:
bsdunzip -o -- -a.jpg -- -b.zip
yeah. twice. i know. it's giving "why is it like this" but it IS like this, so write it twice and move on πβ¨
πΈ that's the whole page bestie, hope your archives are unzipped and your line endings are Unix-style πΈ
this was the Debian build, dated June 27, 2023 β mwah, kisses, bye π
π¦ where this page comes from
- alpine 3.22: libarchive-doc 3.8.10-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.22: libarchive-doc 3.8.11-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.23: libarchive-doc 3.8.10-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.23: libarchive-doc 3.8.11-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.24: libarchive-doc 3.8.10-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- alpine 3.24: libarchive-doc 3.8.11-r0 Β· BSD-2-Clause AND BSD-3-Clause AND Public-Domain
- arch rolling: libarchive 3.8.10-1
- arch rolling: libarchive 3.8.11-1 Β· BSD-2-Clause AND BSD-4-Clause-UC AND Apache-2.0 OR CC0-1.0 OR OpenSSL
- π the page's license: BSD-2-Clause
- Copyright (c) 2007-2008 Dag-Erling SmΓΈrgrav
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms