wiki: add dev-tools section with tmux, screen, and rsync articles
Add three new articles to 03-opensource/dev-tools/: - tmux: persistent terminal sessions, background jobs, capture-pane - screen: lightweight alternative, comparison table - rsync: flags reference, resumable transfers, SSH usage Update all indexes (SUMMARY, section index, main index, README). Article count: 28 → 31. Remove tmux from writing backlog. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
93
03-opensource/dev-tools/tmux.md
Normal file
93
03-opensource/dev-tools/tmux.md
Normal file
@@ -0,0 +1,93 @@
|
||||
# tmux — Persistent Terminal Sessions
|
||||
|
||||
## Problem
|
||||
|
||||
SSH sessions die when your connection drops, your laptop closes, or you walk away. Long-running jobs — storage migrations, file scans, downloads — get killed mid-run. You need a way to detach from a session, come back later, and pick up exactly where you left off.
|
||||
|
||||
## Solution
|
||||
|
||||
`tmux` is a terminal multiplexer. It runs sessions that persist independently of your SSH connection. You can detach, disconnect, reconnect from a different machine, and reattach to find everything still running.
|
||||
|
||||
### Installation (Fedora)
|
||||
|
||||
```bash
|
||||
sudo dnf install tmux
|
||||
```
|
||||
|
||||
### Core Workflow
|
||||
|
||||
```bash
|
||||
# Start a named session
|
||||
tmux new-session -s mysession
|
||||
|
||||
# Detach from a session (keeps it running)
|
||||
Ctrl+b, d
|
||||
|
||||
# List running sessions
|
||||
tmux ls
|
||||
|
||||
# Reattach to a session
|
||||
tmux attach -t mysession
|
||||
|
||||
# Kill a session when done
|
||||
tmux kill-session -t mysession
|
||||
```
|
||||
|
||||
### Start a Background Job Directly
|
||||
|
||||
Skip the interactive session entirely — start a job in a new detached session in one command:
|
||||
|
||||
```bash
|
||||
tmux new-session -d -s rmlint2 "rmlint /majorstorage// /mnt/usb// /majorRAID 2>&1 | tee /majorRAID/rmlint_scan2.log"
|
||||
```
|
||||
|
||||
The job runs immediately in the background. Attach later to check progress:
|
||||
|
||||
```bash
|
||||
tmux attach -t rmlint2
|
||||
```
|
||||
|
||||
### Capture Output Without Attaching
|
||||
|
||||
Read the current state of a session without interrupting it:
|
||||
|
||||
```bash
|
||||
tmux capture-pane -t rmlint2 -p
|
||||
```
|
||||
|
||||
### Split Panes
|
||||
|
||||
Monitor multiple things in one terminal window:
|
||||
|
||||
```bash
|
||||
# Horizontal split (top/bottom)
|
||||
Ctrl+b, "
|
||||
|
||||
# Vertical split (left/right)
|
||||
Ctrl+b, %
|
||||
|
||||
# Switch between panes
|
||||
Ctrl+b, arrow keys
|
||||
```
|
||||
|
||||
### Real-World Use
|
||||
|
||||
On **majorhome**, all long-running storage operations run inside named tmux sessions so they survive SSH disconnects:
|
||||
|
||||
```bash
|
||||
tmux new-session -d -s rmlint2 "rmlint ..." # dedup scan
|
||||
tmux new-session -d -s rsync-migrate "rsync ..." # file migration
|
||||
tmux ls # check what's running
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## tmux vs screen
|
||||
|
||||
Both work. tmux has better split-pane support and scripting. screen is simpler and more universally installed. I use both — tmux for new jobs, screen for legacy ones. See the [screen](screen.md) article for reference.
|
||||
|
||||
---
|
||||
|
||||
## Tags
|
||||
|
||||
#tmux #terminal #linux #ssh #productivity #dev-tools
|
||||
Reference in New Issue
Block a user