Random Awk Shit: Difference between revisions
From Federal Burro of Information
Jump to navigationJump to search
(New page: # show total disk space used for all use devices df -k | awk 'BEGIN { one = 0 ; used = 0 ; avail = 0 }/dev/{one = one + $2 ; used = used + $3 ; avail = avail + $4 }END { print "total\ttot...) |
No edit summary |
||
Line 1: | Line 1: | ||
show total disk space used for all use devices | |||
df -k | awk 'BEGIN { one = 0 ; used = 0 ; avail = 0 }/dev/{one = one + $2 ; used = used + $3 ; avail = avail + $4 }END { print "total\ttotal\ttotal" RS "1kblocks", "used", "avail" RS one, used, avail, used/one, avail/one }' | df -k | awk 'BEGIN { one = 0 ; used = 0 ; avail = 0 }/dev/{one = one + $2 ; used = used + $3 ; avail = avail + $4 }END { print "total\ttotal\ttotal" RS "1kblocks", "used", "avail" RS one, used, avail, used/one, avail/one }' | ||
cat ssl_request_log | awk 'BEGIN{FS=":"}{freq[$1":"$2]++}END{for(word in freq) print word, freq[word]}' | sort | cat ssl_request_log | awk 'BEGIN{FS=":"}{freq[$1":"$2]++}END{for(word in freq) print word, freq[word]}' | sort |
Revision as of 01:08, 12 January 2009
show total disk space used for all use devices
df -k | awk 'BEGIN { one = 0 ; used = 0 ; avail = 0 }/dev/{one = one + $2 ; used = used + $3 ; avail = avail + $4 }END { print "total\ttotal\ttotal" RS "1kblocks", "used", "avail" RS one, used, avail, used/one, avail/one }'
cat ssl_request_log | awk 'BEGIN{FS=":"}{freq[$1":"$2]++}END{for(word in freq) print word, freq[word]}' | sort