How to return a background task to be in the foreground?

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 just pgrep yum and then use kill PID. Or, if you know you only have one yum instance, run pkill yum.


If you are in the same shell, you can always foreground that process with fg (if your shell supports it) at that point you can perform your Ctrl+C.

As others have mentioned, you can use a wide variety of ps and kill options.

If you want, you can even use top and filter to your username and kill that way.


Try this:

kill -QUIT `pidof yum`

This will stop, terminate this process. It may be required to use some better force than QUIT signal, then try TERM and after that try KILL.

You may be also a little more lazy and just do this:

killall -QUIT yum

This will hit all processes named yum.