Created
August 7, 2015 08:32
-
-
Save biggora/1e9d1992d6eb8b497c01 to your computer and use it in GitHub Desktop.
Bash commads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# split string by space | |
# awk -F " " '{print $7}' | |
# example: show banned ip | |
cat /var/log/fail2ban.log | grep Ban | awk -F " " '{print $7}' | |
# count unique value | |
# sort | uniq -c | sort -nr | |
# example: count banned unique ip | |
cat /var/log/fail2ban.log | grep Ban | awk -F " " '{print $7}' | sort | uniq -c | sort -nr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment