🖥️screen

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the screen command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███████╗ ██████╗██████╗ ███████╗███████╗███╗   ██╗
#                ██╔════╝██╔════╝██╔══██╗██╔════╝██╔════╝████╗  ██║
#                ███████╗██║     ██████╔╝█████╗  █████╗  ██╔██╗ ██║
#                ╚════██║██║     ██╔══██╗██╔══╝  ██╔══╝  ██║╚██╗██║
#                ███████║╚██████╗██║  ██║███████╗███████╗██║ ╚████║
#                ╚══════╝ ╚═════╝╚═╝  ╚═╝╚══════╝╚══════╝╚═╝  ╚═══╝
                

                                                                  
# The first command you should run right after you login to a remote server ;-)
screen

# Explanation: With screen you can have multiple shells in the same window. You do not need to open new windows for a second connection to the same remote server, you can simply press C-a c inside the screen session. And if your computer crashes, you screen session on the remote server survives, you can re-attach to a previous screen session with screen -R.

# Start a new named screen session:
screen -S session_name

# Detach from the current session:
Press Ctrl+A then press d

# Re-attach a detached session:
screen -r session_name

# List all screen sessions:
screen -ls

screen ./long-unix-script.sh
# It can be de-attached or re-attached in different sessions. When a command is executing press “Ctrl + A” and then “d” to de-attach. To attach run.

screen -ls
# Note: Here, the later part of this command is screen id, which you can get using ‘screen -ls‘ command.

longcmd ; [Ctrl-Z] ; bg ; disown ; screen ; reptyr $( pidof longcmd )
# Suspend and reattach a process to screen.

# Close specify detached screen
# -X Send the specified command to a running screen session. -S Option to specify the screen session if you have several screen sessions running. screen -ls for listing current screens and its sessionname
screen -X -S [sessionname] quit

# Run a never-ending process in the background in a way that you can check on its status anytime
screen -d -m -S some_name ping my_router

# Explanation: 
    # -d -m start screen in "detached" mode. This creates a new session but does not attach to it.
    # -S some_name gives the screen session a label, so you can easily re-attach to it with screen -R some_name
    # The shell prompt returns immediately, and of course you can logout too, the screen session will continue to run happily.
    # When the specified program exits (in this example ping), its screen window will also exit, and if there are no other windows in the screen session, then the screen session itself will also exit.

# screen
#-----------#

screen -S session_name
Es ist immer eine gute Idee, einen beschreibenden Sitzungsnamen zu wählen.

Im Folgenden sind einige der häufigsten Befehle zum Verwalten von Linux Screen Windows aufgeführt:

Ctrl+a d
Trennen Sie sich von der Linux-Bildschirmsitzung

screen -r
Verbinden Sie sich erneut mit einem Linux-Bildschirm

Ctrl+a c Neues Fenster erstellen (mit Shell)
Ctrl+a " Alle Fenster auflisten"
Ctrl+a 0 Zu Fenster 0 wechseln (nach Nummer)
Ctrl+a A Benennen Sie das aktuelle Fenster um
Ctrl+a S Teilen Sie den aktuellen Bereich horizontal in zwei Bereiche
Ctrl+a | Teilen Sie den aktuellen Bereich vertikal in zwei Bereiche
Ctrl+a tab Schalten Sie den Eingabefokus auf die nächste Region
Ctrl+a Ctrl+a Wechseln Sie zwischen der aktuellen und der vorherigen Region
Ctrl+a Q Schließen Sie alle Regionen außer der aktuellen
Ctrl+a X Schließen Sie die aktuelle Region

screen -S test [abmelden mit Strg+A, d]
screen -ls [Sitzungen auflisten]
screen -r test [neu verbinden]
exit [beendet Bash und die screen Sitzung]

#==============================##==============================#
# CMD SCREEN						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░