< Home

zip

Function

The zip command compresses a file.

The unzip command decompresses the file.

Format

zip source-filename destination-filename

unzip source-filename destination-filename

Parameters

Parameter Description Value
source-filename Specifies the source file name.

The value is a string of 1 to 160 characters in the format of [ drive ] [ path ][ file-name ].

destination-filename Specifies the destination file name.

The value is a string of 1 to 160 characters in the format of [ drive ] [ path ][ file-name ].

Views

User view

Default Level

3: Management level

Usage Guidelines

If you specify only the path of the target file without a file name, the name of the target file is the same as that of the source file. After the compression, the source file remains.

Example

# Compress the file named rsahostkey.dat into a file named destrsa.

<sysname> dir
Directory of hda1:/
  Idx  Attr     Size(Byte)  Date        Time       FileName
   0   -rw-          5,049  Jun 25 2014 14:59:04  vrpcfg.zip
   1   -rw-            396  May 13 2014 12:59:10  rsahostkey.dat
5,445 KB total (690,443 KB free)
<sysname> zip rsahostkey.dat destrsa
Compress hda1:/rsahostkey.dat to hda1:/destrsa?[Y/N]:y
100%  complete 
%Compressed file hda1:/rsahostkey.dat to hda1:/destrsa.
<sysname> dir
Directory of hda1:/
  Idx  Attr     Size(Byte)  Date        Time       FileName
   0   -rw-          5,049  Jun 25 2014 14:59:04  vrpcfg.zip
   1   -rw-            396  May 13 2014 12:59:10  rsahostkey.dat
   2  -rw-            523  Jun 25 2014 15:31:28  destrsa 
5,968 KB total (689,920 KB free)
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic