开发者社区 问答 正文

Linux中怎么压缩目录呢?

Linux中怎么压缩目录呢?

展开
收起
格格的阿里云 2022-04-02 02:07:00 491 分享 版权
1 条回答
写回答
取消 提交回答
  • #建立测试目录,并在里面建立几个测试文件
    [root@localhost ~]# mkdir test
    [root@localhost ~]# touch test/test1
    [root@localhost ~]# touch test/test2
    [root@localhost ~]# touch test/test3
    #压缩目录,并没有报错
    [root@localhost ~]# gzip -r test/
    
    
    
    #但是查看发现test目录依然存在,并没有变为压缩文件
    [root@localhost ~]# ls
    anaconda-ks.cfg anaconda-ks.cfg.gz install.log.gz install.log.syslog test
    
    [root@localhost ~]# ls test/
    testl .gz test2.gz test3.gz
    
    2022-04-02 02:07:29
    赞同 展开评论
问答分类:
问答地址: