Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Using "wc -l" or "sort | uniq -c | sort" to count and classify things.

Count processes and threads by user on Linux:

# ps -Teo euser=,comm= | sort | uniq -c | sort -nr



Another application of this is counting unique IPs in Apache access logs.

  zgrep -Po '^[0-9.]+' /var/log/apache2/test.access.log | sort | uniq -c | sort -n




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: