C-NET :: PROJECTS

cat pausing-and-continuing-a-process-on-linux.md

Pausing and continuing a process on Linux

Posted
Updated
Filed under
Howto's · Linux

If you want to pause a process while you do something else, like for instance stop a heavy file operation while you're just moving some stuff around quickly, there are two signals to pay attention to: STOP and CONT.

STOP will pause a process (not actually stop it - it doesn't die)
CONT continues a stopped process, and does nothing if the process isn't stopped.

An easy way to experiment with this is to start xeyes:

$ xeyes &
[1] 26114
bash

In this case, xeyes got the Process ID (PID) 26114. You can use "ps" to find Process ID's of running processes.

The xeyes window with two eyes

Xeyes is an application that shows two "eyes" on the screen, with eyeballs following your mouse pointer around.

To pause this process I use, in my case "kill -STOP 26114". Notice the eyes stop moving to follow the mouse pointer. "kill -CONT 26114" resumes the application.

Comments