Linux批量解压缩脚本

Posted shaohsiung

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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文件的输出内容

 

以上是关于Linux批量解压缩脚本的主要内容,如果未能解决你的问题,请参考以下文章