Skip to content
Advertisement

How to terminate terminal that is connected to a AWS box but still leave process on?

I have ssh’d into a ubuntu AWS box via terminal on mac. I have successfully setup the process I want to run in the box.

How do can exit out of terminal without killing the process running?

Thank you in advance.

P.S

New to linux and terminal on mac

Advertisement

Answer

Personally I use screen to get in/out of the system while keeping the processes running.

$ sudo apt install screen

To create a new screen:

$ screen -S screen_name

Then do something in your screen, for example running a program, editing files, downloading file with wget, etc.

Later if you want to exit the terminal without killing the running process, simply press Ctrl+A+D. The process will kept running in the background inside the screen

To reconnect to the screen:

$ screen -R screen_name
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement