I would like to be able to send a screen command to a screen session "above" my current screen session (which is on another server). Imagine the scenario of starting an initial screen session and from a window inside this session you ssh to another server and start a screen session on that server. Is it possible to send a screen command through current screen session (which is on the remote server) to the first screen session?
I'm not sure what you mean by "Above" your current screen session, but if you have nested screen sessions (screen within screen), you can tell the outer screen to pass the command key along to the inner screen session. By default, the command key to do this is Ctrl+A, which means that you hit Ctrl+A twice to send a command to the inner screen session.
If I log into server A and start screen, and then SSH from server A into server B and start another copy of screen:
- Ctrl+A,C will create a new screen window on server A
- Ctrl+A,Ctrl+A,C will create a new screen window on server B
- Ctrl+A,Ctrl+A,4 will switch to window #4 on server B
- Ctrl+A,Ctrl+A,Ctrl+D to detach from the screen session on server B
These assume default keybindings.