Random Awk Shit: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
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:Script]]

Latest revision as of 14:26, 24 July 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