Change back into a running process on Linux after you put it into the background

31,450

Solution 1

If it's started from current shell, use standard job-control e.g.

$ jobs

$ gedit &
[1] 3341

$ jobs
[1]+  Running                 gedit &

$ fg %1
gedit

Solution 2

Basically, you can only manage processes with job control that are children of your current shell, that is, jobs started by the shell you are working with. If you did start and background the process with your current shell, fg and the other job control options will work. If not, you cannot manage the job with the shell.

The mostly used "workaround" (actually much more powerful than the shell) is GNU screen.

Share:
31,450
Frank Vilea
Author by

Frank Vilea

Updated on July 09, 2022

Comments

  • Frank Vilea
    Frank Vilea almost 2 years

    I have spawned a process with another application. I can see that it is running with:

    ps -ef

    How can I switch into that process as if I started it manually myself by entering the command into the console?