Pausing and continuing a process on 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

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

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.

Leave a Reply

Your email address will not be published.