Unzip Command In Unix
. bash unzip archive.zip Use code with caution. Copied to clipboard Commonly Used Options -d (Destination): Extract files to a specific folder instead of the current one. bash unzip archive.zip -d /path/to/destination Use code with caution. Copied to clipboard -l (List): See what is inside the zip file without actually extracting it. bash unzip -l archive.zip Use code with caution. Copied to clipboard -q (Quiet): Suppress the list of files being printed to the screen—great for large archives or scripts. bash unzip -q archive.zip Use code with caution. Copied to clipboard -o (Overwrite): Automatically overwrite existing files without asking for permission. bash unzip -o archive.zip Use code with caution. Copied to clipboard -P (Password): Extract a password-protected zip file directly from the terminal. bash unzip -P yourpassword archive.zip Use code with caution. Copied to clipboard Pro-Tip: Installing
: Useful if you know you want to replace existing files of the same name without being asked for confirmation every time. 4. Advanced Use Cases
The most common use case is extracting the entire contents of an archive into the current working directory: unzip archive_name.zip Use code with caution. unzip command in unix
: Suppresses standard output, which is ideal for background scripts where you don't need a wall of text.
For power users and server administrators, unzip can handle more complex scenarios: bash unzip archive
unzip archive.zip filename.txt
unzip archive.zip -x "*.log"
The unzip tool is not always installed by default on every Unix or Linux distribution. You can verify its presence by running unzip -v . If it is missing, use your system’s package manager to install it: