Using the Screen command

Screen command benefits

  • Can be used to launch multiple shells from a single SSH session.
  • Detach and re-attach from multiple ssh session.
  • Running process which can take more time and need session to be kept alive.
  • To keep the session alive without any network disruptions.

The command to create a screen session is

screen -t <screen name> -S <socket file name>

To detach a screen session

ctrl+a + d

To list the screen sessions

screen -ls

To reattach the screen session

screen -r <pid/name from the list>

Presume you lost the console where the screen was running before detaching the screen. You can detach and reattach using the below command

screen -dr <pid/name from the list>

About the Author

Yogi

24 years of experience in various layers of software. Primarily experienced in system side software design and development on server management software. Interested in linux development in x86 and arm architecture.