From e5b4aacc5d30dedc78fe955de6ab340374ca2920 Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 27 Jan 2024 01:27:09 +0000 Subject: deploy: c649f69634104c80d5da8af20871646e7d06aab1 --- monitor/ps.html | 262 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 monitor/ps.html (limited to 'monitor/ps.html') diff --git a/monitor/ps.html b/monitor/ps.html new file mode 100644 index 0000000..f7d11a0 --- /dev/null +++ b/monitor/ps.html @@ -0,0 +1,262 @@ + + + + + + ps - Notes + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+
+

ps(1)

+
ps [opt]
+  opt:
+    --no-header .... do not print column header
+    -o <OUT> ....... comma separated list of output columns
+    -p <PID> ....... only show pid
+    -T ............. list threads
+
+
+

Set PS_FORMAT env variable to setup default output columns.

+
+

Frequently used output columns

+
pid        process id
+pgid       process group id
+tid        thread id
+
+comm       name of process
+cmd        name of process + args (full)
+
+etime      elapsed time (since process started)
+user       user owning process
+
+pcpu       cpu utilization (percent)
+pmem       physical resident set (rss) (percent)
+rss        physical memory (in kb)
+vsz        virtual memory (in kb)
+
+

Example: Use output for scripting

+
for tid in $(ps -o tid --no-header -T -p 31084); do
+    taskset -c -p $tid;
+done
+
+ +
+ + +
+
+ + + +
+ + + + + + + + + + + + + + + + + + +
+ + -- cgit v1.2.3