shell脚本解压多个文件_bash


#!/bin/bash
#查询压缩包出来,然后解压
cd /root/
ls *.tar.gz > ls.log
ls *.tgz >> ls.log
data=$(cat ls.log)
for i in $data
do
#echo $i
tar -zxf $i & > /dev/null
done
rm -rf ls.log