把一个目录下所有的子目录各自打包成tar文件

命令如下:

find . -maxdepth 1 -mindepth 1 -type d -exec tar cvf {}.tar {}  \;


测试后,运行结果如下:

image


参考资料

=============

https://stackoverflow.com/questions/15936003/for-each-dir-create-a-tar-file

posted on 2020-07-28 07:34  中道学友  阅读(1684)  评论(0编辑  收藏  举报

导航

技术追求准确,态度积极向上