Created
February 6, 2019 15:22
-
-
Save adyavanapalli/ed326b356e35104bbe77fa55cfd0b3be to your computer and use it in GitHub Desktop.
Counts and sorts each unique IP address in the NGINX `access.log` file, and pipes the output to `less`.
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
#!/usr/bin/env bash | |
# count_nginx_access.sh | |
sudo sudo awk '{print $1}' access.log | sort | uniq -c | sort -nr | less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment