Languages
[Edit]
EN

Linux screen - most useful commands with practical examples

3 points
Created by:
marc_so
1104

In this article we are gonna have a look at most useful linux screen commands. Most of the time we just need a few screen commands to get the job done. Below we have a lot of them.

Why screen is useful?

Edit

If we run some program from command line and our terminal will shutdown (internet problem, lack of energy) we can't go back to that session. Especially if we run some important installation or download some large file via ssh from another server. It is important to have backup and run this with screen or nohup.

Installation of screen command

Edit
  • If we have debian or ubuntu:
  • If we have centos:

Most useful commands

Edit
  • screen create new session
  • screen detach press keys (in this order - first ctrl, second a, third d)
  • screen list all sessions

Usage example:

  • screen connect to detached session (21173 - id of screen session - NOT ENTIRE NAME, just ID), we can get id by using screen -ls
  • screen kill session (21173 - id of screen session - NOT ENTIRE NAME, just ID)

Usage example:

 

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Linux

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join