The coredumpctl command is a utility in Linux that is used to manage core dumps, which are snapshots of a process’s memory at the time of a crash. Core dumps can be useful for debugging purposes, as they provide information about the state of the process at the time of the crash.
To list all available core dumps, use the following command:
# coredumpctl list
This will display a list of all available core dumps, including the PID of the process, the name of the executable, and the time of the crash.
If you encounter the below error while running the command coredumpctl:
coredumpctl: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install systemd-coredump |
Ubuntu | apt-get install systemd-coredump |
Arch Linux | pacman -S systemd |
Kali Linux | apt-get install systemd-coredump |
CentOS | yum install systemd |
Fedora | dnf install systemd |
Raspbian | apt-get install systemd-coredump |
coredumpctl Command Examples
1. List all captured core dumps:
# coredumpctl list
2. List captured core dumps for a program:
# coredumpctl list program
3. Show information about the core dumps matching a program with `PID`:
# coredumpctl info PID
4. Invoke debugger using the last core dump of a program:
# coredumpctl debug program
5. Extract the last core dump of a program to a file:
# coredumpctl --output=path/to/file dump program