A couple of useful commands for debian etch

Calculate the number of php5-cgi processess running:

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

Display process list of processnames including “php5″:

1
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):

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

Leave a Reply

You must be logged in to post a comment.