Linux批量解压缩脚本

 1 #!/bin/bash
 2 
 3 # 批量解压缩脚本
 4 # 作者: shaohsiung
 5 # 时间: 2018/11/19
 6 
 7 # Store all file names in the tmp directory with the suffix .tar.gz file in the temporary file ls.log
 8 cd /tmp
 9 ls *.tar.gz > ls.log
10 
11 for i in $(cat ls.log)
12     do
13         # Throw the output information at the time of decompression into the recycle bin
14         tar -zxf $i &> /dev/null
15     done
16 
17 # Delete temporary file ls.log
18 rm -rf /tmp/ls.log

 

ls.log文件的输出内容

 

posted on 2018-11-19 18:10  ert999  阅读(374)  评论(0编辑  收藏  举报

导航