How to Use the jobs Command to Manage Background Processes in Linux

The One-Task Terminal Trap

When you first learn to use the Linux terminal, it feels like a single-lane highway. If you execute a command to download a massive 50-gigabyte database backup using wget, the command takes complete hostage of the terminal window. You cannot type any new commands; you are completely locked out, forced to stare at the progress bar until the download finishes.

If you have an urgent server crisis and you need to run a diagnostic tool right now, your natural instinct is to open a brand new SSH connection or launch a second terminal window. But what if you are physically sitting at a stripped-down server rack with no graphical interface and no ability to open multiple tabs? You are trapped.

To break out of this trap, Linux allows you to take any running command and shove it into the background, instantly returning control of the terminal to you. To manage, monitor, and retrieve all of these hidden, background processes, you must master the jobs command.

Step 1: Sending a Command to the Background

You cannot use the jobs command until you actually have jobs running in the background. There are two ways to push a command into the void.

  1. Before it starts (The Ampersand): If you know a command is going to take a long time, simply add an ampersand (&) to the very end of it. (e.g., wget http://massive_file.zip &). Linux will instantly start the download in the background and immediately give you a blank prompt so you can keep working.
  2. While it is running (The Suspension): If you already launched the command, and it is holding your terminal hostage, press Ctrl + Z. This does not kill the command; it physically suspends (pauses) it. To force the paused command to quietly resume working in the background, type bg and press Enter.

Step 2: Listing the Hidden Jobs

Now that you have several massive scripts and downloads running invisibly in the background, you need to know their status. Have they finished? Did they crash? This is where the jobs command shines.

Simply type the command and press Enter:

jobs

The terminal will instantly output a beautifully organized table showing every single process currently hidden in the background attached to your specific terminal session.

[1] + Running wget http://massive_file.zip &
[2] - Stopped nano server_config.txt
[3] Done tar -czvf backup.tar.gz /var/www/

This output tells you exactly what is happening: Job 1 is actively downloading, Job 2 is paused (waiting for you), and Job 3 successfully finished its compression task.

Step 3: Bringing a Job Back to the Foreground

If Job 2 is a text editor (like nano) that you paused using Ctrl + Z to quickly check a network setting, you need to bring it back to the foreground so you can finish editing the file.

You do this using the fg (foreground) command, followed by the specific Job ID number printed in the brackets.

fg %2

The terminal will instantly rip the text editor out of the background, hijacking your screen once again, placing you exactly where you left off.

Step 4: Killing a Runaway Job

If you realize that Job 1 (the massive download) is actually downloading the wrong file and eating all your server bandwidth, you must terminate it. Because it is in the background, you cannot use the standard Ctrl + C kill command.

You must use the kill command explicitly targeted at the Job ID.

kill %1

The system will instantly assassinate the background process. If you type jobs again, Job 1 will say “Terminated,” and it will vanish from the list forever. By mastering the jobs command, you transform a single Linux terminal window into a hyper-efficient, multi-tasking command center.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.