Erik Fredericks, frederer@gvsu.edu Fall 2025
Based on material provided by Erin Carrier, Austin Ferguson, and Katherine Bowers
Execution of a program/command
User process
Daemon process
ps
ps -f
ps -u
top
htop
Process ID (PID)
Child process
Parent process
Parent Process ID (PPID)
The init daemon has a PID of 1 and a PPID of 0 0 refers to the kernel itself
pstree
init daemon
init
The login program starts a bash shell
Process state (ps aux or ps -l)
ps aux
ps -l
S
R
Zombie process
Z
Processes typically run in the foreground when you launch them
To suspend a running process: Ctrl + Z
Ctrl + Z
To resume suspended process in foreground: fg
fg
To resume suspended process in background: bg
bg
jobs to show foreground, background, and suspended processes!
jobs
Can also run in background immediately: command &
command &
In the foreground (running)
Ctrl + c
In the background
kill pid
kill -9 pid
killall processname
processname
sudo
64 different types of kill signals!
Trap: the ability of a process to ignore a kill signal
SIGKILL
When a parent process receives a kill signal
http://1.bp.blogspot.com/_doukgd8PkSU/SoqMf8ulMlI/AAAAAAAAAoU/018wijSVWI8/s320/ZombiePenguin.jpg
make a bash forever script: #!/bin/bash i=0 while : do echo $i i=$((i + 1)) sleep 1 done put into bg - jobs - fg 1 (if 1)