From 813a0eb326a300a5dedaf922edf4ee908d138036 Mon Sep 17 00:00:00 2001 From: tactonbishop Date: Sun, 28 Aug 2022 10:00:04 +0100 Subject: [PATCH] Last Sync: 2022-08-28 10:00:04 --- .../Shell_Scripting/Processes.md | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/Programming_Languages/Shell_Scripting/Processes.md b/Programming_Languages/Shell_Scripting/Processes.md index e0754dd..14a6a40 100644 --- a/Programming_Languages/Shell_Scripting/Processes.md +++ b/Programming_Languages/Shell_Scripting/Processes.md @@ -17,6 +17,31 @@ The command in its most minimal application returns the following 7112 pts/2 00:00:00 ps ``` +With the `-e` modifier we can list more processes: + +``` + PID TTY TIME CMD + 1 ? 00:00:05 systemd + 2 ? 00:00:00 kthreadd + 3 ? 00:00:00 rcu_gp + 4 ? 00:00:00 rcu_par_gp + 5 ? 00:00:00 netns + 7 ? 00:00:00 kworker/0:0H-events_highpri + 9 ? 00:00:00 mm_percpu_wq + 11 ? 00:00:00 rcu_tasks_kthread + 12 ? 00:00:00 rcu_tasks_rude_kthread + 13 ? 00:00:00 rcu_tasks_trace_kthread + 14 ? 00:00:08 ksoftirqd/0 + 15 ? 00:03:20 rcu_preempt + 16 ? 00:00:00 rcub/0 + 17 ? 00:00:00 migration/0 + 18 ? 00:00:00 idle_inject/0 + 20 ? 00:00:00 cpuhp/0 + 21 ? 00:00:00 cpuhp/1 + 22 ? 00:00:00 idle_inject/1 + 23 ? 00:00:00 migration/1 +``` +
pid
Process ID: every currently running process has a unique ID
@@ -43,8 +68,9 @@ The command in its most minimal application returns the following ## Process termination -The general schema is: `kill [pid]`. This allows for process clean-up. If this doesn't succeed you can force with `KILL [pid]` which will terminate the process immediately but is obviously more risky. +The general schema is: `kill [pid]`. This allows for process clean-up. If this doesn't succeed you can force with `KILL [pid]` which will terminate the process immediately but is obviously more risky. We can also start/stop processes with modifiers on `kill`: -* `kill -STOP pid` -* `kill -CONT pid` \ No newline at end of file + +- `kill -STOP pid` +- `kill -CONT pid`