How To Unzip A File In Linux?

Install unzip if needed: `sudo apt install unzip` or `sudo dnf install unzip` or `sudo pacman -S unzip`

Unzip a file: `unzip file.zip`

Unzip to a specific directory: `unzip file.zip -d /path/to/directory`

List contents without extracting: `unzip -l file.zip`

Overwrite files without prompting: `unzip -o file.zip`

Extract only specific files: `unzip file.zip file1 file2`

Unzip a password-protected file: `unzip -P password file.zip`

Unzip all ZIP files in a directory: `for f in *.zip; do unzip “$f” -d “${f%.zip}”; done`

Suggested for You

Trending Today