ssh, and put it to use for my first time, so here’s a post 🙂 Consider you are working on some data on a remote computer/server. You can access this server, but only intermittently. Also, you dont have the patience to keep some window open to stare at the progress of your work, but would like to visit it now and then to know how much of it is complete. Screen is the answer to your problem. The work could be from running simulations (C / C++ / other Terminal executable languages) and even can be extended to Matlab! On a console-only SSH, running
matlabdefaults to the terminal since it cannot open a graphical interface, and this aspect is exploited here.
The most useful feature of screen is the ability to disconnect / close the terminal, without quitting the associated programs. Further, you can reconnect to this “screen” whenever you wish. The terminology used is “detach” and “attach”. Here’s how its done.
- SSH to your account, wherever it is…
- Start a session of screen by typing:
screenThis will auto-generate a weird session id. This can be renamed, but details later
- Now, start your simulation/work in this terminal.
- Detach: Next, you can just close this terminal window, knowing well that your work is being carried out by the server
- In case you want to look at the status, firstly SSH back to the account and do a
screen -lsto get a list of running screens
- Attach: Connect to your screen by typing
screen -r <name_as_in_list>, and you are back to your work!
For more details on the usage of screen, visit this nice and short tutorial.