Skip to content

Instantly share code, notes, and snippets.

@zhensongren
Created February 27, 2020 22:05
Show Gist options
  • Save zhensongren/c176be260c3ea26b8b2b7cff5498c52b to your computer and use it in GitHub Desktop.
Save zhensongren/c176be260c3ea26b8b2b7cff5498c52b to your computer and use it in GitHub Desktop.
run the process without stop after exit terminal

run the process without stop after exit terminal

  1. install GNU screen: apt-get update apt-get upgrade apt-get install screen

  2. type "screen". this will open up a new screen - kind of similar in look & feel to what "clear" would result in.

  3. run the process (e.g.: ./init-dev.sh to fire up a ChicagoBoss erlang server)

  4. type: Ctrl + A, and then Ctrl + D. This will detach your screen session but leave your processes running!

  5. feel free to close the SSH terminal. whenever you feel like it, ssh back into your GCE VM, and type screen -r to resume your previously detached session.

  6. to kill all detached screens, run: screen -ls | grep pts | cut -d. -f1 | awk '{print $1}' | xargs kill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment