🟤GNU Screen / tmux
Screen
GNU Screen creates a 'screen' in background and runs command from shell or script.
In your terminal, execute the screen
command and press space or enter key to close the intro window. you should see no difference after doing so.
then run your command in that open screen session and send it to background with Ctrl+Z
.
then type in bg
to send the screen session itself to the background as well.
after this you will be back to screen and by typing screen -d
the screen session will be sent to your default shell background in that terminal.
now the application is running in background and terminating the terminal or the SSH session will not terminate the process.
If you want to launch and connect to screen:
If you want to launch and not connect to screen:
Works with sessions too:
You can send keypresses to CMD
with stuff
:
To send a new-line, include or ^M
or $'\n'
with the keypresses.
irst create new session :
screen -dmS [session_name]
then attach command or script to run in session created:
screen -x [session_name] [script.sh]
tmux
Terminal multiplexer
Last updated