diff options
Diffstat (limited to 'src/monitor/pgrep.md')
-rw-r--r-- | src/monitor/pgrep.md | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/monitor/pgrep.md b/src/monitor/pgrep.md new file mode 100644 index 0000000..2b52a73 --- /dev/null +++ b/src/monitor/pgrep.md @@ -0,0 +1,15 @@ +# pgrep(1) + +```markdown +pgrep [opts] <pattern> + -n only list newest matching process + -u <usr> only show matching for user <usr> + -l additionally list command + -a additionally list command + arguments +``` + +## Debug newest process +For example attach gdb to newest zsh process from `$USER`. +```markdown +gdb -p $(pgrep -n -u $USER zsh) +``` |