[Linux] tmux
🔹 Step 1: Start a New tmux
Session
tmux
SessionIn your terminal, run:
🔹 This starts a new tmux session.
🔹 Step 2: Run GPU-Burn in the First Pane
Run:
🔹 This will start GPU stress testing in the current terminal.
🔹 Step 3: Split the Terminal (Horizontally or Vertically)
Option 1: Split Horizontally (Top-Bottom)
Press:
🔹 This will split the terminal into two panes, one on top and one on the bottom.
Option 2: Split Vertically (Left-Right)
Press:
🔹 This will split the terminal into two vertical panes.
🔹 Step 4: Switch to the New Pane
After splitting, move to the new pane using:
(Use ←
or →
to switch between panes.)
You can save and restore tmux
sessions so you don’t lose your progress after rebooting or logging out.
tmux
sessions so you don’t lose your progress after rebooting or logging out.💾 Save & Restore a tmux
Session
tmux
Session1️⃣ Save a Session (Detach Without Closing)
If you’re inside a
tmux
session, press:This detaches the session but keeps it running in the background.
To list active sessions:
Example output:
2️⃣ Restore a Saved Session
Reattach to your last session:
(Replace
0
with your session ID fromtmux list-sessions
.)Reattach to the most recent session:
3️⃣ Auto-Restore tmux
Sessions After Reboot
tmux
Sessions After RebootBy default, tmux
does not persist sessions across reboots, but you can fix this.
Option 1: Use tmux-resurrect
Plugin (Best Option)
Install
tmux
plugin manager:Add this to
~/.tmux.conf
:Reload
tmux
:Save a session anytime:
Restore after reboot:
Option 2: Use tmuxinator
(For Automatic Start)
Install:
Create a config:
Edit the config (
~/.config/tmuxinator/mysession.yml
) and define your setup.Start
tmux
with:
Option 3: Manually Save & Restore Sessions
If you don’t want plugins, you can log your session names and reattach manually:
After reboot:
💡 Best Workflow
Detach
tmux
(Ctrl + B, D
) instead of closing it.Use
tmux-resurrect
for auto-saving and restoring.If rebooting often, use
tmuxinator
for structured sessions.
Last updated
Was this helpful?