zoukankan      html  css  js  c++  java
  • unzip

    unzip
    功能说明:unzip命令可以解压zip格式的文件。
     
    参数选项:
    -l   不解压显示压缩包的内容。
    -a   指定解压目录
    -o   解压时不提示是否覆盖文件。
    -v   不会执行解压命令,只是显示详细信息。
     
     
    查看压缩文件
    [root@testdb ~]# touch a.log
    [root@testdb ~]# ls -l a.log
    -rw-r--r-- 1 root root 0 Dec 17 20:06 a.log
    [root@testdb ~]# zip a.log.zip a.log
      adding: a.log (stored 0%)
    [root@testdb ~]# ll a.log*
    -rw-r--r-- 1 root root   0 Dec 17 20:06 a.log
    -rw-r--r-- 1 root root 160 Dec 17 20:07 a.log.zip
    [root@testdb ~]# unzip -l a.log
    Archive:  a.log
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    Archive:  a.log.zip
      Length      Date    Time    Name
    ---------  ---------- -----   ----
            0  12-17-2020 20:06   a.log
    ---------                     -------
            0                     1 file
    
     
    常规解压的一些例子
    说明:解压的文文件如果存在,会提示是否替换。-o参数解压时不提示是否覆盖。-v参数不会执行解压命令,只是查看。
    [root@testdb ~]# ll a.log*
    -rw-r--r-- 1 root root   0 Dec 17 20:06 a.log
    -rw-r--r-- 1 root root 160 Dec 17 20:07 a.log.zip
    [root@testdb ~]# unzip a.log.zip 
    Archive:  a.log.zip
    replace a.log? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
     extracting: a.log                   
    [root@testdb ~]# unzip -v a.log.zip
    Archive:  a.log.zip
     Length   Method    Size  Cmpr    Date    Time   CRC-32   Name
    --------  ------  ------- ---- ---------- ----- --------  ----
           0  Stored        0   0% 12-17-2020 20:06 00000000  a.log
    --------          -------  ---                            -------
           0                0   0%                            1 file
    [root@testdb ~]# unzip -o a.log.zip
    Archive:  a.log.zip
     extracting: a.log 
     
     
    指定解压目录解压文件
    [root@testdb ~]# ll a.log.zip 
    -rw-r--r-- 1 root root 160 Dec 17 20:07 a.log.zip
    [root@testdb ~]# ll a.log*
    -rw-r--r-- 1 root root 160 Dec 17 20:07 a.log.zip
    [root@testdb ~]# unzip -d /tmp/ a.log.zip
    Archive:  a.log.zip
     extracting: /tmp/a.log              
    [root@testdb ~]# ll /tmp/a.log*
    -rw-r--r-- 1 root root 0 Dec 17 20:06 /tmp/a.log


  • 相关阅读:
    ASP.NET MVC 4高级编程(第4版)
    Unity3d报告奇怪的错误CompareBaseObjectsInternal can only be called from the main thread.
    HDU 4862 Jump(更多的联合培训学校1)(最小费用最大流)
    0,22, 47, 120,(? ),290
    它们的定义Activity跳转动画
    ssh探头安全
    Netty:一种非易失堵塞client/server相框
    Swift类和结构
    php+mysql+nginx于linux部署对环境
    javascript 次序li
  • 原文地址:https://www.cnblogs.com/l10n/p/9416707.html
Copyright © 2011-2022 走看看