总结了一下ubuntu下批量解压缩的方法,下面两种比较好用。
第一种方法:xargs传参
ls *.tar | xargs -n1 tar xvf # tar
ls *.tar.gz | xargs -n1 tar xzvf #tar.gz
ls *.tar.gz | xargs -n1 unzip -o #
第二种方法:for循环
for tar in *.tar; do tar xvf $tar; done # tar
for tar in *.tar.gz; do tar xzvf $tar; done #tar.gz
for tar in *.zip; do unzip $tar; done #zip
参考:
https://blog.youkuaiyun.com/silentwolfyh/article/details/53909518
https://blog.youkuaiyun.com/crazycui/article/details/52239234