Created
June 16, 2014 05:40
-
-
Save kunpengku/3a2d4048a172edd7f217 to your computer and use it in GitHub Desktop.
删除大小为0的文件。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#delete file which size equal zero | |
ls -l > .ll.txt | |
while read dt | |
do | |
size=`echo "$dt" | awk '{print $5}'` | |
if [ "$size" == "0" ] | |
then | |
name=`echo "$dt" | awk '{print $9}'` | |
rm -rf ./$name | |
fi | |
done < .ll.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment