You have to be root to do that. Just specify the path in this way:
Code:
echo "/path/to/some/dir/core" > /proc/sys/kernel/core_pattern
To keep this behavior after a reboot you have to add the following lines to /etc/sysctl.conf:
Code:
# Setup a directory to save core files into
kernel.core_pattern = /path/to/some/dir/core
The first line is not really necessary, just a comment to keep track of the modification.