Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete program core file in bash script

Tags:

bash

core-file

I'm trying to delete the core file generated from when my program suddenly crashes.

For that i use this piece of code:

find . -name 'core' -delete

My question is: Is this a correct way of doing it ? Is there a better and more efficient way?

like image 511
laker02 Avatar asked Jun 18 '26 08:06

laker02


1 Answers

If you indeed want to delete those core file, you can use:

find . -name "core*" -exec rm -f {} \;

Note: [including semicolon]

like image 133
mainframer Avatar answered Jun 20 '26 07:06

mainframer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!