Skip to content

Shell task control

Jennings Zhang edited this page Jan 10, 2018 · 1 revision

jobs

  • command1 & runs command1 in the background.
  • jobs lists the current jobs in the environment.
  • CTRL-Z sleeps a command with SIGSTOP.
  • bg [job_id] sends a job to the background.
  • fg [job_id] gives a job foreground control (input stream)

Killing programs

CTRL-C usually cancels the foreground command by sending SIGINT (C) or a KeyboardInterrupt (Python).

If you have zombie processes or frozen applications, simply find them and shut them down through the task manager (gnome-system-monitor). Or,

  • ps displays information about the current process (probably the shell) and its child processes (background processes executed by the shell).
    • ps -g displays information about all running groups of commands.
  • pidof PROGRAM reports the pid of that program.
  • kill -kill PID or kill -9 PID sends SIGKILL (which cannot be caught or ignored), terminating the process.
  • killall PROGRAM ends processes by name.
  • top or htop are high-level text-mode task managers.
Clone this wiki locally