> ## Content Index
> Fetch the complete content index at: https://linuxhandbook.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Suspend and Resume Processes in Linux
- URL: https://linuxhandbook.com/suspend-resume-process/
- Published: 2023-06-01T14:49:30.000Z
- Updated: 2023-09-16T09:24:59.000Z
- Description: Learn how to suspend a running process in the Linux command line. Also learn how to resume a stopped process.
- Author: Sagar Sharma
- Tags: Process Handling, Quick Tip, #cli, #docs-col

Have you ever encountered a situation where you have to suspend an ongoing task as you have more important tasks to execute and want to resume the previous task later?

Actually, it is possible and can be done pretty easily using two [termination signals](https://linuxhandbook.com/termination-signals/): `STOP` and `CONT`.

And in this guide, I will walk you through step-by-step to suspend and resume the process again in Linux.

## Suspending the process in Linux 

You have two options to suspend the process: 

1. Using the `Ctrl + Z` shortcut (for a process running in the foreground)
2. Using the kill command with the `STOP` signal

🤚

A suspended process is denoted as stopped in the terminal. This may confuse you but the 'stopped process' can be resumed. After all, there is a difference between stop (SIGSTOP) and termination (SIGTERM).

### 1\. Suspend a foreground process 

Let me give you an example you can see. I run Firefox from the command line with this command:

```
firefox
```

The browser runs and you can see some strange output on the terminal. That's okay.

No, I suspend the Firefox process which is running in the foreground with the Ctrl+z terminal shortcut: 

```
Ctrl+z
```

And here is what happens. The Firefox process is suspended and you can see it in the terminal. After a few seconds of delay, a dialogue box popups to notify that the Firefox browser is not responding anymore.

![Example of suspending a process in Linux](https://linuxhandbook.com/content/images/2023/06/suspending-process-example-linux.webp)

Click to enlarge

💡

The `Ctrl+Z` keys stop (suspend) a foreground process whereas `Ctrl+C` keys terminate it.

### 2\. Suspend a process by sending STOP signal

When the process is running in the background, you can not use the `Ctrl + Z` shortcut. In that case, you'd have to use the kill command.

Let's see this with an example. I run the [sleep command](https://linuxhandbook.com/bash-sleep/) for a really long time. But I am [running the command in the background](https://linuxhandbook.com/run-process-background/) by adding `&` to it.

```
sleep 4949 &
```

![](https://linuxhandbook.com/content/images/2023/05/run-processes-in-background-in-Linux-1.png)

You can verify the background processes using the `jobs` command:

```
jobs
```

![list background processes](https://linuxhandbook.com/content/images/2023/05/list-background-processes-in-Linux.png)

I can see the process ID in the example. There are various ways to [find process ID](https://linuxhandbook.com/find-process-id/). You can [use the ps command](https://linuxhandbook.com/ps-command/) and grep on the process name.

Once you have the process ID, you can suspend the process using the kill command in the following manner: 

```
kill -STOP <PID>
```

In my case, the PID is 26589, then, I'd have to use the following command:

```
kill -STOP 26589
```

![terminate the process using kill command in terminal](https://linuxhandbook.com/content/images/2023/05/terminate-the-process-using-kill-command-in-terminal.png)

And as you can see, the process is stopped successfully.

## Resuming the process again 

📋

There is no keyboard shortcut to resume a suspended process. 

To resume the process, you'd have to use the `CONT` flag with the kill command as shown:

```
kill -CONT <PID>
```

In my case, the PID was `26589` then, the command would be:

```
kill -CONT 26589
```

![resume the terminated process in Linux](https://linuxhandbook.com/content/images/2023/05/resume-the-terminated-process-in-Linux.png)

And as you can see, after resuming the process, I used the jobs command, which showed the process was running as it should.

## Know more about termination signals

Apart from `STOP` and `TERM` signals which I explained above, the kill command offers various other termination signals to kill the process with different effects.

And we made a detailed guide for how you can use the most popular ones:

[How to use SIGINT and other Termination Signals in LinuxTerminating executing process is more than just kill -9\. Here are some of the prominent termination signals and their usage.![](https://linuxhandbook.com/content/images/size/w256h256/2021/08/Linux-Handbook-New-Logo.png)Linux HandbookSagar Sharma![](https://linuxhandbook.com/content/images/2022/10/termination-signals-linux.png)](https://linuxhandbook.com/termination-signals/)

I hope you will find this quick tip helpful.