LinuxCommandLibrary

gcore

generates process core dumps

TLDR

Generate core dump

$ gcore [pid]
copy
Specify output file
$ gcore -o [corefile] [pid]
copy
Generate for all threads
$ gcore -a [pid]
copy

SYNOPSIS

gcore [options] pid

DESCRIPTION

gcore generates a core dump of a running process without terminating it. It captures the process memory state for debugging or analysis while the process continues running.
The tool attaches to the target process temporarily to create the dump. The resulting core file can be analyzed with debuggers like GDB to examine program state.
gcore is useful for debugging production systems without causing downtime.

PARAMETERS

PID

Process ID to dump.
-o FILE
Output filename prefix.
-a
Dump all threads.
--help
Display help information.

CAVEATS

Requires ptrace permissions. Large processes create large dumps. May briefly pause target process.

HISTORY

gcore is part of GDB (GNU Debugger), providing non-destructive core dump generation for debugging running processes without interrupting service.

SEE ALSO

gdb(1), kill(1), core(5)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community