#!/bin/bash for logfile in /var/log/*log; do echo "Processing: $logfile" # the following line splits the logfile entry line with an empty space as delimiter and then keeps only everything from field five onwards cut -d" " -f5- $logfile | sort | uniq -c | sort -nr | head -5 done
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter