Screen is a useful application. We're only going to cover two of its more common uses in this article.
If you get an answer like /usr/bin/screen or /usr/local/bin/screen go to step three, otherwise go to step two.
For example, while at home, I log into a server at work. I have something that might take time on the server, but my connection between home and work is problematic. So, I get on through our company's VPN and log into the server.
Now, I have to copy a very large directory which may take 20 minutes. If my connection gets cut off during that twenty minutes, something may go wrong. However, if I use screen
|screen cp SP02 SP02.bak|
I can now detach the screen. The default key combination to preface any command to screen is ctrl+A (which will be abbreviated as C-a). So
This will detach the screen. I can now log off. Ten minutes later, I wish to check on its progress so once again I connect and
The d and r stand for detach and reattach. If the process is finished, I will get a message that there is no screen to be resumed. Otherwise, it will put me back where I was when I detached the screen.
Another handy use of screen is to make two windows in a console. To do this
This creates a second window. The cursor is still in the top window
One tabs to the second window, then does the C-a combination again and c. You will then be able to enter a command. This is far less cumbersome to do than it may seem from reading it.