Difference between revisions of "Awk"

From Freephile Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
== Examples ==
 
== Examples ==
get first column from mw table data
+
; get first column from mw table data
 
  awk '/\|-/{getline;print}' /tmp/terror.txt | sed s/\|// | sed s/'^ *'// | sort -u  
 
  awk '/\|-/{getline;print}' /tmp/terror.txt | sed s/\|// | sed s/'^ *'// | sort -u  
 +
 +
; see who's trying to SSH into your server (brute force attack)
 +
awk '/Invalid user/ {print $8}' /var/log/auth.log | sort | uniq -c
  
 
== Docs ==
 
== Docs ==

Revision as of 13:44, 1 February 2017