Top IP Addresses – Linux shell interview question
A log file is of the following format
sessionid ipaddress 1234 127.0.0.1 4567 127.0.0.1
Find the list of top 10 IP Addresses that have the most log entries.
Just another WordPress weblog
A log file is of the following format
sessionid ipaddress 1234 127.0.0.1 4567 127.0.0.1
Find the list of top 10 IP Addresses that have the most log entries.
cat LOG_FILE | awk '{ print $2}'| sort | uniq -c | sort -r +0 -1 | head -10 | awk '{print $2" ->" $1}'
Buy:Levitra.Cialis Professional.Soma.Viagra Soft Tabs.Propecia.Cialis.Viagra Super Active+.Maxaman.Zithromax.Viagra.Cialis Super Active+.Tramadol.Viagra Super Force.VPXL.Super Active ED Pack.Viagra Professional.Cialis Soft Tabs….