当前位置:   article > 正文

Linux Centos 7 压缩和解压缩命令_centos7压缩文件夹命令

centos7压缩文件夹命令

1.zip文件压缩

语法:zip 加压缩后的文件名 加要压缩的文件名。

  1. [root@localhost ~]# zip test.zip test.txt
  2. adding: test.txt (deflated 100%)
  3. [root@localhost ~]#

后面出现进度条百分比数字说明已经压缩好了然后你在ll验证一下看看有没有你命名的文件包。

  1. [root@localhost ~]# ll
  2. 总用量 820004
  3. -rw-------. 1 root root 1587 322 16:58 anaconda-ks.cfg
  4. -rw-r--r--. 1 root root 1635 322 17:00 initial-setup-ks.cfg
  5. -rw-r--r--. 1 root root 838860800 326 14:56 test.txt
  6. -rw-r--r--. 1 root root 814270 326 14:57 test.zip
  7. [root@localhost ~]#

2. zip 文件解压缩

zip 解压缩就在zip 前面加个un ,要指定路径的话就加个 -d

语法就是 unzip 要解压的文件名 -d 指定解压路径

  1. [root@localhost ~]# unzip test.zip -d /tmp/
  2. Archive: test.zip
  3. inflating: /tmp/test.txt
  4. [root@localhost ~]#

是不是很简单,然后再ls 加你指定的路径去验证一下有没有你解压出来的文件,有的话就说明你成功了。恭喜你成功学会了zip 压缩和zip 解压!!!然后我们继续....

[root@localhost ~]# ls /t
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/703311
推荐阅读
相关标签
  

闽ICP备14008679号