Linux Tricks

In this article i would like to share some linux command tricks, which may help you through the admin day.

count the connection per port:
netstat -plan|grep :80|awk {‚print $5‘}|cut -d: -f 1|sort|uniq -c|sort -nk 1 | wc -l
delete files older than 5 days:
find /path_to_check/temp* -type d -ctime +5 -exec rm -Rf {} \;
show zombie processes:
ps aux | awk ‚{ print $8 “ “ $2 }‘ | grep -w Z
kill zombies:
ps -ef | grep defunct | awk ‚{ print $3 }‘ | xargs kill -9