Linux & shell: Terminal tools (tmux, jq, background jobs)
8 Linux & shell commands: Terminal tools (tmux, jq, background jobs). Click a command to see what each part does.
Linux & shell: Terminal tools (tmux, jq, background jobs)Index
- Whole sheet251
- Navigate & list13
- Create, copy, move, delete13
- View & compare files9
- Permissions & ownership31
- Help & shell basics11
- Users & groups6
- Install packages7
- Package & software versions29
- System info9
- Network basics & SSH10
- Zip & compress4
- Shell operators6
- Processes6
- Files & search8
- Text processing pipelines4
- Disk3
- Network5
- Services & logs6
- Archives & copying4
- Firewall7
- Scheduling: cron & systemd timers6
- Storage, mounts & LVM10
- Kernel, hardware & limits8
- Performance & tracing10
- TLS & certificates8
- Packet capture & network debugging10
- Terminal tools8
Terminal tools (tmux, jq, background jobs)8
tmux new -A -s <name>Start or reattach a tmux sessionWhat each part does
tmux new -s <name>new named session that survives SSH disconnects-Aattach instead if it already exists
Tip Detach with Ctrl+B then D; list with tmux ls.
<command> | jq '.items[] | {name: .metadata.name, phase: .status.phase}'Pretty-print and filter JSONWhat each part does
| jq '...'JSON processor.items[]iterate over an array{name: ..., phase: ...}build a smaller object with just those fields
jq -r '.[] | select(.state=="running") | .name' <file>.jsonRaw values from JSON for scriptsWhat each part does
-rraw strings, no quotesselect(.state=="running")keep only matching items.nameprint one field
yq '.spec.replicas' <file>.yaml; yq -i '.spec.replicas = 3' <file>.yamlRead or edit YAMLWhat each part does
yq '.path'read a value (jq syntax for YAML)yq -i '...'edit the file in place
nohup <command> > <log> 2>&1 &Keep a command running after logoutWhat each part does
nohupignore the hangup signal sent when you log out> <log> 2>&1send output and errors to a log&run in the background; jobs and fg to manage it
timeout 30s <command>Stop a command that runs too longWhat each part does
timeout 30skill the command after 30 seconds; exit code 124 if it timed out
cat <list> | xargs -P 8 -I{} <command> {}Run commands in parallelWhat each part does
xargs -P 8up to 8 at a time-I{}replace {} in the command with each input line
until <command>; do echo retrying; sleep 5; doneRetry a command until it succeedsWhat each part does
until <command>loop while the command failssleep 5wait between attempts
Nothing matches.
My DevOps Playbook by Angelo John Calleja