Ads 468x60px

##EasyReadMore##

16 12月, 2016

ShellScript 批次壓縮解壓 tar

批次解壓:

1
2
3
4
5
6
7
#!/bin/sh
for unzipfile in $(ls *.tgz)
do
tar -zxf $unzipfile
echo "$unzipfile done!"
rm $unzipfile
done


批次壓縮:

1
2
3
4
5
6
#!/bin/sh
for zipfile in $(ls)
do tar -czf $zipfile.tgz $zipfile
echo "$zipfile done!"
rm -r $zipfile
done

玉米BYIS: 批次壓縮解壓tar系列的ShellScript - https://goo.gl/Rl8t5f

0 意見:

張貼留言

 
Blogger Templates