By default on many Linux distributions core files generation is disabled.
If you choose to enable it (because let's say you might have applications crashing and you want to see an image of the application's process memory at the time of termination) and control the name of the core file generated you need to edit /proc/sys/kernel/core_pattern. The default value in this file is "core", which means that core files will be dumped in the working directory and the filename is core. If you want to change this pattern and dump the core files in /tmp direcory and also append the process ID to the file name do the following (be aware that this is a system wide settting):
If you choose to enable it (because let's say you might have applications crashing and you want to see an image of the application's process memory at the time of termination) and control the name of the core file generated you need to edit /proc/sys/kernel/core_pattern. The default value in this file is "core", which means that core files will be dumped in the working directory and the filename is core. If you want to change this pattern and dump the core files in /tmp direcory and also append the process ID to the file name do the following (be aware that this is a system wide settting):
echo /tmp/core%p > /proc/sys/kernel/core_pattern
or
sysctl -w kernel.core_pattern=/tmp/core%p
If you choose to make the change persistent after reboot edit the /etc/sysctl.conf file and add: