screenNow you have a shell open in screen. Do stuff, whatever. When you want another "window"...
CTRL-a cMaybe you want to name the current window?
CTRL-a ADo stuff in your current window. Then...
CTRL-a CTRL-aCTRL-a "CTRL-a pCTRL-a nNow, suppose you want to shut down your laptop but not lose all the windows in your session. (Or perhaps you've SSH'ed into a server somewhere and are running screen there but now you want to close the connection.)
CTRL-a CTRL-dAnd when you want to come back and reattach to all your screen sessions?
screen -d -rIf you want to close a screen window, 'exit' like you would normally. When you exit the last window, screen will close.
Note: This is how I solve the "I need to use the bathroom at this coffee shop and take the MBP with me so no one steals it but I don't want to lose all my sessions by closing my laptop" problem... :)
And to see a list of open sessions on a machine...
screen -lsHat tip: http://freebsd.munk.me.uk/archives/185-Improve-Your-Shell-Life-With-Scre... (thanks!)
You can create a ~/.screenrc file to specify settings and default behaviors for screen. Do a web search for examples.
My .screenrc
# Screen command settings.
autodetach on
startup_message off
defscrollback 5000
vbell_msg "* ding *"
# Fix scrolling, in case we don't want to use CTRL+a [
# Assumes xterm or a variant like OSX's xterm-color
termcapinfo xterm* ti@:te@
# Statusline (should be one-line)
hardstatus alwayslastline '%{gk}[ %{G}%H %{g}][%= %{wk}%?%-Lw%?%{=b kR}[%{W}%n%f %t%?(%u)%?%{=b kR}]%{= kw}%?%+Lw%?%?%= %{g}][%{Y}%l%{g}]%{=b C}[ %D %m/%d %C%a ]%{W}'