In Linux Server Hacks, First edition, Hack #6 can be improved by using uniq to count the number of "missing" files, rather than the for loop, and letting sort find the number and reverse the order:
grep "File does not exist" error_log | \
awk '{print $13}' | \
sort | \
uniq -c | \
sort -rn | \
head -20
See also:
- Linux Server Hacks #6
- man uniq
- man sort
fgrep "File does not exist" /home/virtual/site*/fst/var/log/httpd/error_log | awk '{print $13}' | sort | uniq -c | sort -n | awk '$1 >= 10 '
The last awk mean show any line with $1 greater than or equal to 10.