Difference between revisions of "Awk"
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 == |