From e830fa716bedecbff8c3a572d1d20061342ec4c7 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Tue, 27 Aug 2024 23:05:39 +0200 Subject: mv monitor -> process --- src/process/pgrep.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/process/pgrep.md (limited to 'src/process/pgrep.md') diff --git a/src/process/pgrep.md b/src/process/pgrep.md new file mode 100644 index 0000000..b2cf466 --- /dev/null +++ b/src/process/pgrep.md @@ -0,0 +1,16 @@ +# pgrep(1) + +```markdown +pgrep [opts] + -n only list newest matching process + -u only show matching for user + -l additionally list command + -a additionally list command + arguments + -x match exactly +``` + +## Debug newest process +For example attach gdb to newest zsh process from `$USER`. +```markdown +gdb -p $(pgrep -n -u $USER zsh) +``` -- cgit v1.2.3