How to use the unzip command in Linux?
In Linux, the unzip command is used for decompressing zip format compressed files. To use the unzip command, you can follow the following format:
unzip file.zip
The file name of the zip file to be decompressed is file.zip. The decompressed file will be placed in the current directory.
You can use the following format to decompress to a specific directory:
unzip file.zip -d /path/to/directory
/path/to/directory is the directory path where the files will be extracted to.
In addition to the basic functions mentioned above, the unzip command also has some other commonly used options, such as:
- – l: List the contents of the zip file
- -q: Silent mode, does not display detailed information during the decompression process.
- -o: overwrite existing file
- Only decompress the files, do not decompress the folder.
- -Password: Use the password to decrypt and extract the encrypted zip file.
To see more options and usage of the unzip command, you can use the following command to view the help documentation of unzip:
man unzip