Typorithm · medium

Processes & Signals

bash-processesbashpskilljobs
Saved on this device
Full lesson · 8 learning steps Open any exercise for focused practice
1

Step 1 of 8 · intro card

Learn Processes & Signals

0%

System

ps aux lists running processes; kill sends a signal to a PID — -9 is SIGKILL (force), -15 SIGTERM (graceful default); a trailing & runs a command in the background as a job; jobs lists them; and %1 refers to background job number 1.

ps aux prints a snapshot of every process on the system — user, PID, CPU and memory use, and the command. Piping it through grep node narrows the list to the processes you care about.

kill sends a signal to a process by PID. The default is SIGTERM (-15), a polite request to shut down; -9 is SIGKILL, which the kernel forces and the process cannot catch or ignore. Reach for -9 only when a graceful stop fails.

A trailing & runs a command in the background as a shell job, returning the prompt immediately. jobs lists the shell's jobs by number, and you can signal one with a job spec like %1 instead of looking up its PID.

01

ps aux lists running processes; pipe to grep to filter.

02

kill -9 is SIGKILL (force); -15 is SIGTERM (graceful).

03

& backgrounds a job; jobs lists them; %1 targets job 1.

ps aux | grep node
kill -9 1234
jobs
sleep 60 &
kill %1

Read the implementation

Connect each part of the code to the concept before you type.

1. List processes

ps aux lists every running process; grep node filters the output to lines mentioning node.

ps aux | grep node

2. Force kill a PID

kill -9 sends SIGKILL to process 1234, forcing it to stop immediately.

kill -9 1234

3. List background jobs

jobs prints the shell's background and stopped jobs with their job numbers.

jobs

4. Run in background

A trailing & runs sleep 60 in the background as a job, freeing the prompt.

sleep 60 &

5. Kill a job by number

%1 refers to background job number 1, so kill %1 signals that job.

kill %1

A complete learning loop

01

Understand

Read the concept map and follow the code breakdown.

02

Reconstruct

Type the implementation, repair mistakes and work through every recall exercise.

03

Verify

Use the final check without hints; revisit weak concepts in short practice sessions.

Processes & Signals: Lesson & Practice · Typorithm | ApplyDjinn