The unzip
command in Linux is used to extract files from ZIP archives. It allows you to decompress and restore the original files that were compressed using the zip
command or any other compatible compression tool.
To use the unzip
command, open a terminal and type:
unzip <archive_name>
Replace <archive_name>
with the name of the ZIP archive you want to extract.
For example, to extract the contents of a ZIP archive called “myarchive.zip” in the current directory, you would run:
unzip myarchive.zip
The unzip
command will extract the files and directories from the archive and restore them to the current directory.
You can also specify a destination directory to extract the files to. To do this, use the -d
option followed by the desired destination path. For example:
unzip myarchive.zip -d /path/to/destination
This will extract the files from “myarchive.zip” and place them in the specified destination directory.
The unzip
command provides additional options for advanced usage, such as selecting specific files to extract, excluding certain files, or listing the contents of the archive without extracting them. You can refer to the unzip
command’s manual page by running man unzip
for more detailed information on these options and their usage.
Remember that you need to have the unzip
utility installed on your Linux system to use the unzip
command. If it’s not installed, you can typically install it using your package manager.