Skip to content

Instantly share code, notes, and snippets.

@leandrosiow
Last active April 3, 2020 19:47
Show Gist options
  • Save leandrosiow/eda86580710972e1a3ed70b81148e9ce to your computer and use it in GitHub Desktop.
Save leandrosiow/eda86580710972e1a3ed70b81148e9ce to your computer and use it in GitHub Desktop.
Here is how you can quickly count something in a log file
cat /var/log/messages | grep error | awk '{print $1,$2,$3}' | uniq -c | sort -nr | head -n 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment