-
-
Save anonRegions/66c2e9681bfe472c59f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Using screen to maintain sessions on a remote machine. (This also just works locally). | |
# ssh into your remote host e.g. ssh user@host | |
# sets up a screen session called mysession | |
screen -S mysession | |
# Exiting the terminal (e.g. shutting your laptop) will "detach" the screen session (i.e. run it in the background). | |
# To see what screen sessions are running: | |
screen -ls | |
# To reconnect | |
screen -R mysession # resumes a detached session or creates one if it doesn't exist | |
# Shortcut from localhost for ssh-ing and starting up screen. Consider alias-ing if you use this a lot. | |
ssh user@host screen -R mysession | |
# To navigate within screen, the command character is Control-a by default, e.g. | |
Control-a ? # help page that shows you all available commands | |
Control-a c # creates a new window within the same session | |
Control-a a # switches between windows | |
Control-a d # detach this screen session | |
exit # exiting will close this screen window | |
# My ~/.screenrc | |
# Change the command character to Control-b so that Control-a still skips to the front of the line | |
# e.g. Control-b ? is help, Control-b b will switch between windows | |
escape ^Bb | |
startup_message off # Turn off the splash page | |
defscrollback 30000 # 30000-line scrollback buffer | |
# Pair programming: http://wiki.networksecuritytoolkit.org/nstwiki/index.php/HowTo_Share_A_Terminal_Session_Using_Screen#Sharing_A_Screen_Session_With_Another_User | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment