screen — terminal multiplexer
cheat sheet · GNU screen https://lab.dimsanych.ru/en/wiki/screen/Cheat sheet
-
screen -S namenew named session -
screen -lslist sessions -
screen -r nameattach to a session -
screen -d -r namedetach from another terminal and attach here -
Ctrl+a ddetach — the session keeps running -
screen -dmS job cmdstart detached right away, for scripts
Options
-S gives the session a name instead of a pid number — without it,
screen -ls shows hard-to-read identifiers. -d -r solves the common
"session busy on another terminal" problem: it detaches it there first,
then attaches it here.