I would like to know how to stop a running process after appending it with &
.
For example, I would like to install software foo
. Now, assume, foo
has many dependancies, it takes an hour to finish. So, I do: yum install foo &
. But I would like to stop that on-going process either by making it foreground (the actual premise of my question) so I can interrupt it, or through other methods if necessary.
Ctrl+C does not seem to stop this.
Best Answer
If the terminal you launched the command from is still open, you can get it back by running
fg
.If it is not, identify the process ID by running
ps aux | grep yum
or justpgrep yum
and then usekill PID
. Or, if you know you only have oneyum
instance, runpkill yum
.