tmux – running scripts from background

0

Steps to Use tmux
Start a new tmux session: Open your terminal and type the following command to create a new session (optionally with a name, e.g., mysession):
bash
tmux new -s mysession
You will now be inside the tmux environment. You may notice a green status bar at the bottom of the terminal.
Run your command: Execute the long-running command or script as you normally would within this new session (e.g., ./my_long_script.sh).
Detach from the session: To leave the session running in the background, use the tmux prefix key combination:
Press Ctrl + B simultaneously.
Then, release both keys and press D (for detach).
You will be returned to your main shell, and a message like [detached from session mysession]will confirm the process is running in the background.

tmux new -s mysession
Ctrl BD

tmux attach -t mysession

Share.

About Author

Leave A Reply