2

I wanted to keep a program, redshift, running in the background instead of having to keep a terminal constantly opened. I learned from a forum that I can do this by typing $ redshift & followed by $ disown. However, I can't figure how to stop this process without restarting my computer. I'm sure it was described somewhere, but I'm illiterate when it comes to Linux. If you can please explain in simple terms how to stop this, I would appreciate it.

1 Answers1

3

The first step is to find the id number of the process (known as the Process ID - PID). A nice utility for finding it is pgrep, where you can specify part of the name of the process and it returns the PID of each match:

pgrep redshift

ps aux | grep redshift is also helpful to determine the right process if there are more than one match.

The next step is to send a signal then will terminate the process:

kill PID

where PID is the number returned by pgrep

You can send different signals with different semantics, e.g. kill -SIGKILL PID is guaranteed to terminate the process, but it leaves no room for cleanup; kill PID and/or kill -SIGINT PID are usually preferable.

There is also pkill that will send a signal to a process matched by name.

user000001
  • 3,635