Monitoring Activity

Nov 8, 2025

Managing shell jobs

  • Use command & to start a job in the background
  • To move a job to the background
    • First, stop it by typing Ctrl-z
    • Next, type bg to move it to the background
    • Use fg to bring it back to the foreground
  • Use jobs for a complete overview of running jobs

Observing process information with ps

  • The ps command has two different dialects: BSD and System V
    • In BSD, options do not have a leading -
    • In System V, options do have a leading -
  • ps shows an overview of current processes
  • ps aux shows an overview of all processes
  • ps -fax shows process forks
  • ps -fU {user} shows all processes owned by user
  • ps -f --forest -C sshd shows sshd and all the children
  • ps L lists format specifiers
  • ps -L shows threads
  • ps -eo pid,ppid,user,cmd example of using format specifiers to get what you want

Monitoring memory usage

  • Use free -m to get details about current memory usage
  • More detailed memory information is in /proc/meminfo

Write cache

  • While writing files, a write cache (buffer) is used
  • This write cache is periodically committed to disk by the pdflush kernel thread
  • As a result, after committing a file write, it’s not immediately secure
  • To ensure that a file is committed to disk immediately, use the sync command

Observing CPU load

  • CPU load is checked through uptime

Monitoring activity with top

  • top is a dashboard that allows you to monitor current system activity
  • Press f to show and select from available display fields
  • Press M to filter on memory usage
  • Press W to save new display settings
  • Press 1 to show the usage stats for all CPUs

Lab Exercise

  1. Use the appropriate utilities to find out if your machine performance is in good shape
Solution
  1. Use top

- Clint Jordan