How to use GNU Screen
To launch screen, just run
Then run all of your commands like
stata -b do filename. When you want to “minimize” the terminal, just press Ctrl+A followed by the D key.
You can then safely log out of ssh without killing the precess that you ran.
ssh back into the server, you can check back on the process by running
This will reopen the terminal that you just closed.
You can create a new tab inside of a screen by pressing Ctrl+A followed by the C key. You will then have a tab 0 and a tab 1.
You can swap between tabs by pressing Ctrl+A followed by Shift+’ (actually Shift+”).
You can close a tab by pressing Ctrl+D or just running
Managing multiple screens
You can create a second screen by running
you can list all open screens by running
There are screens on: 2239.tty.host (Detached) 2044.tty.host (Detached) 22287.tty.host (Detached) 3 Sockets in /var/run/screen/S-user.
You can specify which screen you want to connect to using the name from the list.
screen -r 2044.tty.host
The pid (the number part) is also sufficient
screen -r 2044
You can close a screen using Ctrl+D