Linux command
gcore 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Generate core dump
gcore [pid]
Specify output file
gcore -o [corefile] [pid]
Generate for all
gcore -a [pid]
说明
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.
参数
- -o _FILE_
- Output filename prefix.
- -a
- Dump all threads.
- --help
- Display help information.
FAQ
What is the gcore command used for?
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.
How do I run a basic gcore example?
Run `gcore [pid]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o _FILE_ do in gcore?
Output filename prefix.