Search code examples
bashterminalbackground-processrecovery

Can I get the output of a independent background job again? (e.g. a job run in `screen`, and I close the terminal)


as described in title:
first:I run screen in terminal
second:run ping google.com
then:I press CTRL-Ad to exit to normal terminal and close it

And I want to know if I can get the output of command ping google again?


Solution

  • After you press <c-a> d the screen session will continue running in background and closing the "normal terminal" would not kill the screen. Afterwards you can re-attach to the screen session with screen -r.