Computer Tips - Linux: How do I enable/disable core dumps?

Date: 2009jan24 Updated: 2020jun3 OS: Linux Product: bash Q. Linux: How do I enable/disable core dumps? A. Core dumps are every useful for debugging crashes but they can create clutter also. Enable this way:
ulimit -c unlimited
Disable this way:
ulimit -c 0
You can put either of these commands in your ~/.bashrc file if you wish. Also, check /proc/sys/kernel/core_pattern
cat /proc/sys/kernel/core_pattern
If it starts with a | then its sending the core to anther program. Make it leave a core on disk with:
echo 'core.%e.%p' > /proc/sys/kernel/core_pattern