Linux Centos 7 压缩和解压缩命令

1.zip文件压缩

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

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

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

[root@localhost ~]# ll
总用量 820004
-rw-------. 1 root root      1587 3月  22 16:58 anaconda-ks.cfg
-rw-r--r--. 1 root root      1635 3月  22 17:00 initial-setup-ks.cfg
-rw-r--r--. 1 root root 838860800 3月  26 14:56 test.txt
-rw-r--r--. 1 root root    814270 3月  26 14:57 test.zip
[root@localhost ~]# 

2. zip 文件解压缩

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

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

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

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

[root@localhost ~]# ls /t
  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值