Posts

Showing posts from August, 2016

Command to find number of IP hits in http using access.log

tail -n2000 /var/www/domains/*/*/logs/access_log | awk '{print $1}' | sort | uniq -c | sort -n | awk '{ if ($1 > 20)print $1,$2}'

Command to find a word in current folder and subfolders

find . - type f - exec grep word / dev / null {} + 'word' is where you have to put the search phrase.

How to kill all zombie process in a Linux server

We can't just kill a zombie process because they are already dead processes. Inorder to remove them from the ps list, you need to kill its parent process. You can use the following command to kill the parent process of zombie processes. kill - 9 $ ( ps - A - ostat , ppid | grep - e '[zZ]' | awk '{ print $2 }' )