Basic process monitoring and control


ps # list processes.
  • With no arguments, lists processes running in current shell.
  • Lists :

    Options :


    pstree [user-id] - display process chain in a tree pattern.

    Some Options :

  • With no user ID, lists all process, may be too large to be useful.
  • Some options only work on user's own processes, unless user is admin.


    top - list top processes by CPU usage.
    Keystroke process control

    ^c # [ctrl]c - interrupt a process.

    ^d # [ctrl]d - end of file.

    ; # semi-colon - allows user to specify multiple commands on cmd line.

    & # ampersand - allows user to specify multiple commands on cmd line.

  • Placed at the end of a command.
  • Starts command as a background process.
  • Next command starts without previous command completing.
  • If command requires standard input, it will stop until user attends to it.

    ^z # [ctrl]z - suspends current foreground process (stopped).

  • Use fg or bg to restart process.
    jobs # lists background jobs or processes in current shell.
  • Lists both running and stopped jobs.
  • Numbered sequentially from one or from current background job. Options
    bg # background - starts a suspended background process.
  • bg
  • bg %1
    fg # foreground - brings a background process to the foreground.
  • fg
  • fg %1
    kill PID # signal process change to targeted process.
  • Most common used to generate a terminate (kill) signal.
  • Available both as a bash function and as a stand alone program.
  • User can only signal (kill) own processes.
  • Options and features vary between versions.
  • Many signals can be trapped by process.
  • Some signals are untrappable. e.g kill -9 PID

    Some Options :

    /bin/kill [-n] PID # (system) send signal to ID'ed process.

    kill [-n] {PID|Job-ID} # (bash) send signal to ID'ed process.


    pgrep program # lists PID of processes matching program name.
  • options to further refine match.
  • will identify all matches even if owned by others.


    pkill program # finds processes matching program name and kills them.
  • options to further refine match.
  • options to specify signal to send.
  • will only be applied to processes owned by issuer> # use regular expression to describe process to target.


    killall cmd-name # kills set of related processes in single action.

  • cmd-name name of process being targeted.
  • Only usable on processes you own.

    Some Options :


    Our systems are set to a user to run only 50 processes. If a process attempts to spawn more than this it will be blocked.

    However, because the command interpreter is also a process, you may find that once you hit this limit, you may not be able to stop the run-away process on your own. Please contact your professor or the sysadmin for help.