Using Screen
Screen allows you to:
- Use multiple shell windows from a single SSH session.
- Keep a shell active even through network disruptions.
- Disconnect and re-connect to a shell sessions from multiple locations.
- Run a long running process without maintaining an active shell session.
Using Screen
screento enter screen mode^a+dto detachscreen -lsshow current screensscreen -r [pid]resume screen
multiple windows:
^a+cto create a new window (with same screen pid)^a+nswitch to next window^a+pswitch to previous window
logging:
^a+ H to start\end logging or usescreen -Lin essentialcat screenlog.0to print log
alias stresc='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"'
stresc screenlog.0 > screenlog.0.txt
to get rid of escape sequences to see log in text editor
lock:
^a+x
kill window:
^a+korexit