Just a quick howto on using GNU screen. Very useful when you have a long running task and you don’t want to it to quit when you leave the shell.

  1. Create a new session
[root@station ~]# screen -S 1
  1. Do stuff that takes time to process.
# pg_restore
# CMD-A d (detaches the screen)
# logout
  1. List screen:
[root@station ~]# screen -list
There is a screen on:
	29760.1	(Detached)
1 Socket in /tmp/screens/S-root.
  1. Attach to a currently running screen session
[root@station ~]# screen -r

Or attach using a screen name

[root@station ~]# screen -r 29760.1