unzip
Parameters
Parameter | Description | Value |
---|---|---|
source-filename | Specifies the name of a source file to be decompressed. | The value is a string of 1 to 64 case-sensitive characters without spaces in the [ drive ] [ path ] file name format. In the preceding parameter, drive specifies the storage device name, and path specifies the directory and subdirectory. You are advised to add : and / between the storage device name and directory. Characters ~, *, /, \, :, ', " cannot be used in the directory name. |
destination-filename | Specifies the name of a destination file that is decompressed. | The value is a string of 1 to 64 case-sensitive characters without spaces in the [ drive ] [ path ] file name format. In the preceding parameter, drive specifies the storage device name, and path specifies the directory and subdirectory. You are advised to add : and / between the storage device name and directory. Characters ~, *, /, \, :, ', " cannot be used in the directory name. |
Usage Guidelines
Usage Scenario
You can decompress files, especially log files that are stored on the storage device and run the more command to query the file.
The following describes the drive name.
flash:/my/test/ is an absolute path.
selftest/ is related to the current working directory and indicates the selftest directory in the current working directory.
Precautions
If the destination file path is specified while the file name is not specified, the designation file name is the same as the source file name.
The source file persists after being decompressed.
The compressed file must be a .zip file. If a file to be decompressed is not a zip file, the system displays an error message during decompression.
The source file must be a single file. If you attempt to decompress a directory or multiple files, the decompression cannot succeed.
Example
# Decompress log file syslogfile-2012-02-27-17-47-50.zip that are stored in the syslogfile directory and save it to the root directory as file log.txt.
<Huawei> pwd flash:/syslogfile <Huawei> unzip syslogfile-2012-02-27-17-47-50.zip flash:/log.txt Extract flash:/syslogfile/syslogfile-2012-02-27-17-47-50.zip to flash:/log.txt?(y/n)[n]:y 100% complete Decompressed file flash:/syslogfile/syslogfile-2012-02-27-17-47-50.zip flash :/log.txt.