1

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.

  • pgrep redshift to get the PID, and then kill PID. – user000001 Mar 10 '18 at 18:39
  • ok, great, then I'll add it as an answer – user000001 Mar 10 '18 at 18:49
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.