Blog by Edo Frederix edofrederix@gmail.com RSS

A couple of useful commands on Linux

February 27, 2008

Abstract

This blogitem gives some usefull commands that I've been using frequently. Just as a reference...

Calculate the number of php5-cgi processess running:

ps aux | grep php5-cgi | grep -v "(root|grep)" | wc -l

Display process list of processnames including “php5″:

ps axo 'pid user cmd' | grep php5 | grep -v "(root|grep)"

Analyse apache access.log: Display top 10 ip client ip addresses (in order to trace a ddos attack):

tail access.log | cut -d ' ' -f 1 | sort | uniq -c | sort -n -b -r | head -10