Random Awk Shit: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
No edit summary
No edit summary
Line 3: Line 3:


  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
[[Category:Scripts]]

Revision as of 01:28, 4 May 2024

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