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.
This is a repository of all of my Linux/Unix writings as well as useful tips and tricks for systems administration, engineering, and programming.
Showing posts with label xargs. Show all posts
Showing posts with label xargs. Show all posts
Thursday, July 8, 2010
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
/usr/bin/find /var/log/tomcat -name *.tgz -ctime +15 | xargs rm -rf
Subscribe to:
Posts (Atom)