Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tmux detach while running script

Tags:

terminal

tmux

So I have a script that I would like to run on my server and not have it bother me. So I thought I would run the server in a tmux window and then detach it so I could simply attach if I ever want to look at the progress (this script will take days to run).

but when I run my script in the tmux window, I am not able to detatch while it is running. Is there something I am doing wrong? How can I detach while this still runs? I feel like I am being very oblivious to an obvious solution here.

like image 494
Ryan Saxe Avatar asked Aug 15 '14 17:08

Ryan Saxe


People also ask

What command combination will detach your terminal from a running tmux session?

To detach from a session you invoke the shortcut (ctrl-b)—followed by d , for detatch, or by typing detach explicitly.

How do I Unjoin a tmux session without closing?

First press CTRL + b the press d . This detaches your session. You then press CTRL + d to log out of ssh. Your detached session still keeps running on the server.

How do I detach and reattach tmux?

Basic Tmux UsageUse the key sequence Ctrl-b + d to detach from the session. Reattach to the Tmux session by typing tmux attach-session -t my_session .


1 Answers

You can detach from a tmux session while leaving the script running by:

CTRL + b, then pressing d

You can enter back into the session by running tmux attach -t <session id>

like image 149
Lemon Avatar answered Nov 13 '22 02:11

Lemon