A named GNU screen session maint was detached.
Reconnect to it from another login shell.
Which command is appropriate?
screen -r maint reattaches to an existing detached named session. Processes inside the session can continue after SSH disconnects.
Detailed explanation
screen -S maintIncorrect. screen -S typically creates or selects a session rather than reattaching to a detached one.
screen -r maintCorrect. screen -r maint reattaches the detached session.
screen -d /bin/shIncorrect. This starts a session with a command rather than reattaching to maint.
screen --fg maintIncorrect. --fg is not the standard screen reattach option.
Try it yourself
An example you can run in a temporary verification environment.
screen --help 2>&1 | head || trueExpected result
screenがある場合はhelp。sessionは作らないKey points
- screen -r
- Detach
- Reattach
Notes
- Environment: GNU screen helpのみ
- Use a disposable process or test shell when checking lifecycle commands.
- Exact output and option names can vary slightly by distribution and tool version.
Foundation review
Place the operation
Creating a screen session and reattaching to a detached one are different lifecycle operations.
Check the side effect
List existing sessions before attaching so the selected name and state are unambiguous.