screen -r // Using screen to handle disconnected ssh sessions
Before ssh, first initiate a “screen” session, ssh from there, then disconnect from the “screen window” – change locations, reconnect, all will be intact. Similar behavior in OSX and Linux, with the basics.
Example use case: start remote ffmpeg jobs without having to preserve ssh connection during the render:
1. screen -S ServerName -> ssh Server -> start ffmpeg jobs -> disconnect
2. screen -r ServerName to check on the status / do other tasks
Just the very basics:
screen #create a screen with defaults screen -S SessionName #create screen with a custom session name
ctrl-a d #disconnect from session (without killing it) ctrl-a k #disconnect & kill the current session
screen -ls #list the current sessions available for reconnection screen -r SessionName #reconnect to "SessionName" screen -r [ID] #reconnect to session by "ID" screen -r #reconnect to default session
VIEW Sources BELOW FOR MORE COMMANDS:
DASUNHEGODA, CYBERCITI