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.
Asked
Active
Viewed 3,705 times
2

Ken Chester
- 23
1 Answers
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
pgrep redshift
to get the PID, and thenkill PID
. – user000001 Mar 10 '18 at 18:39