Artificial intelligent assistant

How to suspend and bring a background process to foreground I have a process originally running in the foreground. I suspended by `Ctrl`+`Z`, and then resume its running in the background by `bg <jobid>`. I wonder how to suspend a process running in the background? How can I bring a background process to foreground? **Edit:** The process outputs to stderr, so how shall I issue the command `fg <jobid>` while the process is outputting to the terminal?

As Tim said, type `fg` to bring the last process back to foreground.

If you have more than one process running in the background, do this:


$ jobs
[1] Stopped vim
[2]- Stopped bash
[3]+ Stopped vim 23


`fg %3` to bring the `vim 23` process back to foreground.

To suspend the process running in the background, use:


kill -STOP %job_id


The SIGSTOP signal stops (pauses) a process in essentially the same way `Ctrl`+`Z` does.

example: `kill -STOP %3`.

sources:

* How to send signals to processes in Linux and Unix
* How to manage background and foreground jobs.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a7534079b4988928786ceecef38c7607