http://www.ibm.com/developerworks/library/l-awk1.html
http://www.mindbend.org/scripts
http://www.thegeekstuff.com/2010/02/awk-conditional-statements/
ll | awk '/Pyrami/ {print $9}'
awk -F":" '{ print $1 }' /etc/passwdll| awk '{if($9=="test"){ print $9} else print "6"}'
IFS=$'\012'; for d in `find . -type d`; do s=$(ls -AlF $d | grep -v / | awk '{ $5 = $5/1024; sum += $5; } END \ { print sum}') c=$(ls -AF $d|wc -l) ;
printf "%-20s" ${c} ${s}KB ${d} >>usage; printf "\n">>usage; donels -al | awk '{sum = sum + $5} END {print sum}'
find . \( -name "CORE_*" -o -name "c-*" \) -mtime -1 -exec ls -l {} \; |awk '/^-/ {total += $5} END {printf "%15.2f\n",total}'
find /path -mtime +1 -printf "%s\n"|awk '{sum+=$0}END{print sum}'
No comments:
Post a Comment