Use screen command to create a new virtual window from a single SSH session, and run other stuff there. In the example below we’ll be installing screen and then running a Django dev server in a new virtual terminal window.
apt-get install screen screen python manage.py runserver
You will see that Django server has started running.
Ctrl+A and then press the
D key to detach from that screen. It will say:
[detached from ###.pts-0.hostname]
You can now safely logout from your terminal, log back in to your terminal, do other bits of coding in other directories, go for a vacation, do whatever you want.
To return to the screen that you have detached from
To kill the django server now, simply press
Ctrl+C like you would’ve done normally.
To terminate this current screen instead of detaching from this screen, use
It will say:
[screen is terminating]
For more information about using screen check out thease articles: