---
title: "linux常用sh脚本 "
layout: post
date: 2018-12-24
tag:
- Linux
categories: LINUX
blog: true
---

## 循环解压
```bash
#!/bin/bash
for targz in *.tar.gz;
do
   echo $targz;
   dirname=${targz:0:8}
   #dirpath=d:/$dirname
   dirpath=/data/release/beian.tss.sng.com/image/$dirname
   mkdir -p $dirpath
   tar -zxvf $targz -C $dirpath
done;
```