GNU Screen Handbook

system
ID: 20151020 ACCESSING DATA...
SYSTEM: ARCHIVE FILE: GNU SCREEN HANDBOOK STATUS: ACTIVE

GNU Screen is a very useful tool to run a long script on a server and make sure the script will run even if your computer gets disconnected, runs out of battery or whatever.

In this article, I’ll assume you’re already familiar with the basic concepts of GNU screen, and I’ll just provide you with some tips that I use to make this tool even more convenient.

  1. Attach to the session in question.
  2. Ctrl + a
  3. Type “:sessionname mySessionName” - yes, the first colon is needed there, no extra spaces.
  4. Type Enter.
screen -l

Once the job is done, you can kill the session, either by attaching to it and then exiting the terminal, or directly by killing the session without having to connect to it first, like so:

screen -X -S [session_id] kill

Tags: