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. so README and readme are 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.
  • -d dir β€” 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 πŸ™ˆ
  • -I encoding
  • -O encoding β€” 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 -q was specified.
  • -P password β€” 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 -l by 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 πŸ’€
  • -x pattern β€” 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. 2023 not 23, we're doing full lore now πŸ—“οΈ
  • -Z mode β€” emulate zipinfo(1L) mode. enabling zipinfo(1L) mode changes the way in which additional arguments are parsed. currently only zipinfo(1L) mode 1 is 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 below memberdir. ✨
🚨 big important note bestie: only one of -n, -o, and -u may 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