Scripted detached session

Spawn background session and inject a command; survives SSH disconnect

tmux new-session -d -s work && tmux send-keys -t work 'tail -f /var/log/app.log' Enter

tool
tmux17 commands
tags
tmuxtroubleshootingmonitoring

More tmux commands

  • tmux capture-pane -p -S -3000 -t work > /tmp/pane.log

    Dump last 3000 lines of a pane to a file for triage without attaching

  • tmux new-session -s work

    Start a new tmux session named 'work'

  • tmux attach-session -t work

    Attach to an existing named session

  • tmux ls

    Show all active tmux sessions

  • <prefix> d

    Detach from current session leaving it running in background

all 17 tmux commands