aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/SUMMARY.md3
-rw-r--r--src/pgrep.md15
2 files changed, 17 insertions, 1 deletions
diff --git a/src/SUMMARY.md b/src/SUMMARY.md
index eac8dad..7f385d7 100644
--- a/src/SUMMARY.md
+++ b/src/SUMMARY.md
@@ -10,7 +10,8 @@
- [lsof](./lsof.md)
- [pidstat](./pidstat.md)
- [time](./time.md)
-- [pmap](./pmap.md)
+- [pgrep](./pgrep.md)
+- [pstack](./pstack.md)
- [pstack](./pstack.md)
- [perf](./perf.md)
- [OProfile](./oprofile.md)
diff --git a/src/pgrep.md b/src/pgrep.md
new file mode 100644
index 0000000..2b52a73
--- /dev/null
+++ b/src/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)
+```