Skip to content
Learn Netverks

Lesson

Step 30/36 83% through track

process-management-bash

Process management

Last reviewed May 28, 2026 Content v20260528
Track mode
none
Means
Read / quiz
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Process management: the syntax, patterns, and safety habits you need before advancing in Bash.

Teams still ship Process management in Bash codebases—skipping it leaves gaps in debugging and code reviews.

You will apply Process management in contexts like: CI jobs, server maintenance, local dev automation, and Git hooks.

Read each lesson, copy bash examples into your own terminal, and complete the lesson MCQs—there is no in-browser runner for security reasons.

Toward the end of the track—consolidate before interview prep and production checklist lessons.

Bash scripts start, monitor, and stop processes. Know signals, PIDs, and foreground/background control before managing servers.

Listing processes

ps aux | head
pgrep -l bash
pid=$$
echo "this shell pid=$pid"

$$ is current shell PID—useful for unique temp files.

Signals

# SIGTERM (15) polite stop; SIGKILL (9) force
kill 12345
kill -9 12345

Try SIGTERM first; SIGKILL cannot be caught—last resort for stuck processes.

nohup

nohup long-task.sh > task.log 2>&1 &
disown

nohup keeps running after logout—still prefer systemd for production services.

Important interview questions and answers

  1. Q: SIGTERM vs SIGKILL?
    A: TERM allows cleanup; KILL forces immediate termination.
  2. Q: What is $$?
    A: Current shell process ID.

Self-check

  1. Which signal number is SIGKILL?
  2. What does nohup help with?

Tip: Prefer systemd units over nohup for production daemons.

Interview prep

$$?

PID of current shell.

SIGTERM vs SIGKILL?

TERM allows graceful stop; KILL forces immediate termination.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • kill vs kill -9?
  • nohup when?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump