The unzip command in Linux and Unix-like systems is used to extract the files from a zip archive. The unzip command is the counterpart of the zip command.
Here are a few examples of how the unzip command can be used:
Extract all files from a zip archive: unzip archive.zip
Extract all files to a specific directory: unzip archive.zip -d /path/to/directory
Extract only specific files: unzip archive.zip file1.txt file2.txt
Extract files and directories with a specific extension: unzip archive.zip -x '*.txt'
Extract and overwrite files without prompt: unzip -o archive.zip
Extract and display archive contents: unzip -l archive.zip
The -d option can be used to extract the files to a specific directory.
The -x option can be used to exclude files with a specific pattern or extension.
The -o option can be used to overwrite files without prompting for confirmation.
The -l option can be used to display the contents of the archive without extracting the files.
In case of password protected archive, you will be prompted to enter the password before extracting the files.
It's also possible to use unzip -v archive_name.zip to list the detailed information about the archive and unzip -t archive_name.zip to test the archive for integrity, if there's any error in the archive it will be displayed.