美文网首页
Linux中批量压缩文件夹

Linux中批量压缩文件夹

作者: 屠夫_bc13 | 来源:发表于2018-07-06 11:20 被阅读0次
    for i in `find ./* -type d`;do zip $i.zip ./$i/*;done
    

    'find ./* -type d' 表示查找所有文件夹,-type d就表示指定文件夹类型,这种方法是把每个文件夹单独压缩,一个文件夹对应一个压缩包

    或者

    tar -zcvf  test.tar.gz test1 test2   
    

    这是把多个文件夹压缩在同一个压缩包

    相关文章

      网友评论

          本文标题:Linux中批量压缩文件夹

          本文链接:https://www.haomeiwen.com/subject/cruvuftx.html