Showing posts with label xargs. Show all posts
Showing posts with label xargs. Show all posts

Thursday, July 8, 2010

Killing zombie processes

Kill those persistent and annoying zombie processes.


ps -e -o ppid,stat | grep Z | cut -d" " -f2 | xargs kill -9

Tested on Fedora for accuracy.  

Wednesday, June 17, 2009

Remove old files

If you don't use logrotate to remove or archive old logs, here is a way to remove old logs using the -ctime directive within the bash command find.

/usr/bin/find /var/log/tomcat -name *.tgz -ctime +15 | xargs rm -rf