Saturday, March 01, 2014

screen and nohup

Not long ago, I introduced nohup to let a program continue executing after you exit or logout from your ssh session..

then not long after that, I introduced screen for UART/COM/serial communication

then I found out, using "screen" is a much wiser choice.
Simply flow are as follow:

  1. create a screen
  2. execute whatever you want to run, probably something like a server
  3. detect a screen (ctrl-a, d)
There you go. Server will continue to listen after you log off your ssh session.

In case you want to go back to that screen, just re-attach it
  1. list screen (screen -ls)
  2. re-attached the screen (screen -r [screen name])
  3. there, ctrl -c to quite your program or server or whatever, then type exit to exit the screen