Day 04 Advanced Topics

Processes and System Monitoring

View running processes, manage them, control services with systemctl, and monitor disk and memory.

~1 hour Hands-on Precision AI Academy

Today’s Objective

View running processes, manage them, control services with systemctl, and monitor disk and memory.

Processes and System Monitoring is one of the most important topics in Linux in 5 Days. This lesson builds the foundation you need before moving to more advanced concepts — take time with each example and run the code yourself.

Viewing Processes

Process commands
PROCESS COMMANDS
# List all processes
ps aux
# ps aux | grep nginx ← find a specific process

# Interactive process viewer
top # built-in, Ctrl+C to exit
htop # prettier version (install if needed)

# htop keys:
# F9 = kill process
# F6 = sort by column
# / = search
Signals and Kill
SIGNALS AND KILL
# Get PID from ps aux output
kill 1234 # send SIGTERM (graceful)
kill -9 1234 # send SIGKILL (force kill)
killall nginx # kill all processes named nginx
pkill -f 'python app'  # kill by command pattern

# Background jobs
sleep 60 & # run in background
jobs # list background jobs
fg %1 # bring job 1 to foreground
bg %1 # continue job 1 in background
systemctl: Managing Services
SYSTEMCTL: MANAGING SERVICES
# Start/stop/restart
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx  # reload config without restart

# Enable/disable on boot
sudo systemctl enable nginx
sudo systemctl disable nginx

# Check status
systemctl status nginx
journalctl -u nginx -f # follow nginx logs
Disk and Memory
DISK AND MEMORY
df -h # disk usage by filesystem
du -sh ./mydir/ # size of a directory
du -sh * | sort -h # sizes of all items, sorted

free -h # memory usage
cat /proc/meminfo # detailed memory info

# Find large files
du -ah . | sort -rh | head -20
📝 Day 4 Exercise
Monitor Your System
  1. F
  2. i
  3. n
  4. d
  5. t
  6. h
  7. e
  8. P
  9. I
  10. D
  11. o
  12. f
  13. a
  14. r
  15. u
  16. n
  17. n
  18. i
  19. n
  20. g
  21. p
  22. r
  23. o
  24. c
  25. e
  26. s
  27. s
  28. .
  29. S
  30. t
  31. o
  32. p
  33. i
  34. t
  35. .
  36. S
  37. t
  38. a
  39. r
  40. t
  41. a
  42. s
  43. e
  44. r
  45. v
  46. i
  47. c
  48. e
  49. w
  50. i
  51. t
  52. h
  53. s
  54. y
  55. s
  56. t
  57. e
  58. m
  59. c
  60. t
  61. l
  62. .
  63. C
  64. h
  65. e
  66. c
  67. k
  68. i
  69. t
  70. s
  71. s
  72. t
  73. a
  74. t
  75. u
  76. s
  77. .
  78. F
  79. i
  80. n
  81. d
  82. t
  83. h
  84. e
  85. t
  86. o
  87. p
  88. 5
  89. l
  90. a
  91. r
  92. g
  93. e
  94. s
  95. t
  96. d
  97. i
  98. r
  99. e
  100. c
  101. t
  102. o
  103. r
  104. i
  105. e
  106. s
  107. i
  108. n
  109. /
  110. v
  111. a
  112. r
  113. .
  114. C
  115. h
  116. e
  117. c
  118. k
  119. m
  120. e
  121. m
  122. o
  123. r
  124. y
  125. u
  126. s
  127. a
  128. g
  129. e
  130. .

Supporting Resources

Go deeper with these references.

Linux Die
Linux Command Reference Comprehensive reference for Linux commands, flags, and shell built-ins.
DigitalOcean
Linux Basics Tutorial Series Step-by-step tutorials for new Linux users with practical examples.
GitHub
Bash Guide Community bash guide covering scripting, arrays, functions, and error handling.

Day 4 Checkpoint

Before moving on, make sure you can answer these without looking:

Continue To Day 5
Shell Scripting