Starting, Detaching, Reattaching, and Stopping Screen
To begin a screen session, simply run screen from a terminal. It will be easier to reattach to a session later if you name the session when starting. Use the -S parameter to do so:
where name is an identifier for the session that you make up.
Commands to screen, covered more in depth in the next session, start with Ctrl+a. To detach from a screen session, use Ctrl+a then Ctrl+d. Reattach by running:
Occasionally screen needs to force a detach before it can successfully reattach. This is done with:
The list of currently active sessions is given by:
If you use screen regularly, you may want to put that command in your .bash_profile so that when you log in the active screens are shown. To quit a screen session, simply exit from all active windows. When there are no windows left, you will be dropped back to your standard shell session.
Useful screen commands
All commands in screen, for the most part, begin with Ctrl+a. To see the built in help, first press Ctrl+a then ‘?’. That is, type a question mark with shift+/. Listed in the help screen are several Ctrl+a commands. I have some of the more common ones below.
Split screen is a little tricky. To get a split console, begin a screen session. Use the Ctrl+a, S command to create the split. Then Ctrl+a, tab to switch to the newly created split. Create a new session with Ctrl+a, c. When finished, exit from the split session shell and use Ctrl+a, X to close the split.
No comments:
Post a Comment