Start a detached session from a script
Start a background session and send a command to it; it keeps running after SSH disconnects
tmux new-session -d -s work && tmux send-keys -t work 'tail -f /var/log/app.log' Enter
- tool
- tmux17 commands
More tmux commands
-
tmux capture-pane -p -S -3000 -t work > /tmp/pane.logSave the last 3000 lines of a pane to a file for review, without attaching
-
tmux new-session -s workStart a new tmux session called "work"
-
tmux attach-session -t workAttach to an existing session by name
-
tmux lsShow all running tmux sessions
-
<prefix> dLeave the current session; it keeps running in the background