diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2024-01-28 22:46:25 +0100 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2024-01-31 23:51:53 +0100 |
commit | 178e99296104836281c723c6746e3025610acfc3 (patch) | |
tree | b576541d8e478fa5ff8c53d00e2a0a3ed892e2a8 /src/monitor | |
parent | c649f69634104c80d5da8af20871646e7d06aab1 (diff) | |
download | notes-178e99296104836281c723c6746e3025610acfc3.tar.gz notes-178e99296104836281c723c6746e3025610acfc3.zip |
ps: add thcount,ppid,signal output flags and examples
Diffstat (limited to 'src/monitor')
-rw-r--r-- | src/monitor/ps.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/monitor/ps.md b/src/monitor/ps.md index 7e86678..a935c5c 100644 --- a/src/monitor/ps.md +++ b/src/monitor/ps.md @@ -6,13 +6,16 @@ ps [opt] --no-header .... do not print column header -o <OUT> ....... comma separated list of output columns -p <PID> ....... only show pid + -C <name> ...... only show processes matching name -T ............. list threads + --signames ..... use short signames instead bitmasks ``` > Set `PS_FORMAT` env variable to setup default output columns. Frequently used output columns ``` pid process id +ppid parent process id pgid process group id tid thread id @@ -21,11 +24,18 @@ cmd name of process + args (full) etime elapsed time (since process started) user user owning process +thcount thread count of process +nice nice value (-20 highest priority to 19 lowest) pcpu cpu utilization (percent) pmem physical resident set (rss) (percent) rss physical memory (in kb) vsz virtual memory (in kb) + +sig mask of pending signals +sigcatch mask of caught signals +sigignore mask of ignored signals +sigmask mask of blocked signals ``` ## Example: Use output for scripting @@ -34,3 +44,17 @@ for tid in $(ps -o tid --no-header -T -p 31084); do taskset -c -p $tid; done ``` + +## Example: Watch processes by name +```sh +watch -n1 ps -o pid,pcpu,pmem,rss,vsz,state,user,comm -C fish +``` + +## Example: Show signal information +```sh +# With signal masks. +ps -o pid,user,sig,sigcatch,sigignore,sigmask,comm -p 66570 + +# With signal names. +ps --signames -o pid,user,sig,sigcatch,sigignore,sigmask,comm -p 66570 +``` |