//View Tip #680
Similar Tips
» Randomized find
» Pipe files to an archive
» Checksum directory recursively
» List only the files that have been updated today.
» Moved Trac and Subversion repositories to another machine/direct

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
Use this to find core files and remove them:

find . | egrep "\/core\.[0-9]+$" | xargs rm -f

This works well as it finds only core files.


View Comments »




Comments 

Add your comment

Comments are currently disabled
John
wow, that's needlessly complicated and inefficient.  This is better:

find . -name "core.*" | xargs rm -f
Posted 2009-04-17 13:02:12
Mattes
How about that?
find . -type f -regex '.*/core\.?[0-9]*$' -ls -exec rm -f {} \;
Posted 2009-04-17 13:02:37
nfw
or

find . -type f -regex '.*/core\.?[0-9]*$' -delete
Posted 2009-04-17 14:13:10
You may want to try it without the rm first or use rm -i because there could be files that match the description that are not core dump files. It finds a lot of SVN files when I just have it print results.
Posted 2009-04-19 20:55:11

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit