码迷,mamicode.com
首页 > 系统相关 > 详细

Linux批量解压缩脚本

时间:2018-11-19 20:20:48      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:alt   nbsp   put   col   ssi   lin   bin   分享图片   names   

 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批量解压缩脚本

标签:alt   nbsp   put   col   ssi   lin   bin   分享图片   names   

原文地址:https://www.cnblogs.com/shaohsiung/p/9984531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!