system_space=$(df -h / | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{print $5}' | sed 's/%//') echo "space used: $system_space%" if [ $system_space -gt 80 ]; then echo "Low system space!" echo "Files larger than 1GB:" find / -type f -size +1G -exec ls -lh {} \; 2>/dev/null fi echo "read a string" read string words=$(echo -n "$string"|wc -w) chars=$(echo -n "$string"|wc -c) space=$(expr length "$string" - length `echo "$string"|sed "s/ //g"`) specialsymbols=$(echo $string|grep -o [^A-Za-z0-9_[:space:]]|wc -l) echo "The number of words = $words" echo "The number of characters = $chars" echo "Number of white spaces = $space" echo "Number of Special symbols =$specialsymbols"