I recently had occasion to go through my home directory, where I discovered a large number of files labeled as core (for example, core.26734), which are described as some sort of crash data file. I had 71 such files, taking up 1.2 GB of space on my hard drive.
Why are these files created, and why do they take up so much space? They don't seem to be readable or viewable and seem to serve no real purpose except to clutter up my hard drive.
Is there a way to either keep them from being created, delete them upon shutdown or startup, or actually view them to see what they are about? Thanks.
Core files are the files that are created by the system.These files are the exception and errors that applications throw out to the system and are being transported to $HOME directory.So in order not see the big amount that rubbish your $HOME directory,open the file /etc/profile and delete this line:
[$UID=0]&&ulimit -S -c 1000000 > /dev/null 2>&1
and edit in this line the following shell script command:
ulimit -S -c 0 > /dev/null 2>&1
Save the file.Beware not to change anything else in this file.Then reboot PC and you will have all time your $HOME directory clean of core files.
Answer out of the old forum given by serjant and copied by Yogibaer
And you know why?
ulimit -S -c 0 > /dev/null 2>&1
So ulimit controls all available processes started by shell.
-c puts the maximum size of core files created. In our case we make 0.
And -S option responses for changing and reporting the soft limit associated with a resource.
[$UID=0]&&ulimit -S -c 1000000 > /dev/null 2>&1
and edit in this line the following shell script command:
ulimit -S -c 0 > /dev/null 2>&1
Since everything seems the same except for the number, can I simply change 1000000 to 0 or do I actually take out the stuff in brackets and the two & symbols as well? Sorry to be so dense. Thanks.
Walt
Yes ,you made right and then reboot your PC.And enjoy sam without core files in your home directory
@Walt H: If the problem is solved please edit your first post and change the topic to :
[solved] core files gobbling up disk space
Thank you!