All tags
Start here · terminalTmux for beginners, sessions, windows and panes that survive a dropped connection18 steps · 21 min read · Beginners on the Linux command lineStart the guide terminal
Narrow down
Guides3
- GuideAdvanced tmux, a config that grows with you, formats, layouts and moreThis advanced tmux guide builds on the beginners series with a modular config covering vi-style copy mode, clipboard integration, and a functional status bar. It dives into layouts, workspace scripts, formats, popups, menus, plugins like tmux-resurrect, and SSH workflows including nested tmux sessions, all tested against tmux 3.8.9 steps · 52 min read
- GuideTmux for beginners, sessions, windows and panes that survive a dropped connection18 steps · 21 min read
- Guide🐳Guide: Updating Docker Containers via the Unraid TerminalUpdate a Docker container such as Jellyfin from the Unraid terminal, step by step, and learn why the command line gives you more control than the Update button.9 steps · 3 min read
Shell305
- Tip
cat config.yml | xsel -ibXsel -ib and xsel -ob move text between a Linux terminal and the clipboardCopy command output to the desktop clipboard and paste it back from the terminal.3 Dec 2026 - Tip
zoxide query -ls projectzoxide query -ls shows which folders your shell thinks you use mostList the folders zoxide remembers, with scores, to understand its jumps.3 Dec 2026 - Tip
ioreg -rn AppleSmartBattery | grep CycleCountioreg prints your MacBook battery cycle count in the terminalPrints the battery cycle count of a MacBook straight from the terminal.3 Dec 2026 - TipTerminal can save your windows and tabs as a window groupSave a set of Terminal windows and tabs under a name and reopen them in one click.3 Dec 2026
- TipExport a Terminal profile to a .terminal file and import it on another MacCopy your Terminal colours, fonts and shell settings to another Mac with an exported profile file.3 Dec 2026
- Tip
tmux new -d -s report -x 200 -y 50 'top'tmux new -d -x 200 -y 50 gives a detached session a real sizeStarts a background tmux session wider than 80 columns, so scripts don't get wrapped output.3 Dec 2026 - Tip
less -i /var/log/syslogless -i ignores case in searches unless your pattern has a capital letterMakes searches in less case-insensitive, except when you type a capital letter.2 Dec 2026 - Tip
mcRun mc in the Unraid web terminal for a two-pane file managerStarts the built-in Midnight Commander to browse and copy files between shares and disks from the terminal.2 Dec 2026 - Tip
hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}'hidutil remaps Caps Lock to Escape without installing anythingRemaps a key on the Mac keyboard from Terminal, until the next restart.2 Dec 2026 - Tip
sudo tmutil restore -v "/Volumes/Backup Disk/Backups.backupdb/My Mac/2026-11-30-120000/Macintosh HD - Data/Users/me/Documents/report.pdf" ~/Desktop/Tmutil restore copies a file out of a Time Machine backup from TerminalRestores a single file or folder from a Time Machine backup without opening the Time Machine browser.2 Dec 2026 - Tip
sudo tmutil deletelocalsnapshots 2026-11-30-120000Tmutil deletelocalsnapshots removes one local Time Machine snapshot by dateDeletes the local Time Machine snapshots for one date from Terminal to free disk space.2 Dec 2026 - Tip
set -g allow-passthrough onset -g allow-passthrough on lets escape codes in a pane reach your terminalLets programs inside tmux send terminal-specific escape codes, such as iTerm2's, past tmux.2 Dec 2026 - Tip
watch -c ls --color=always -l /var/logwatch -c keeps the colors that a command printsShow colored output in watch instead of plain or garbled text.1 Dec 2026 - Tip
sudo nvram BootPreference=%01 # only block lid openStop your MacBook from starting up when you open the lidKeep a shut down laptop off until you press a key or button.1 Dec 2026 - Tip
screencapture -R 0,0,1280,720 ~/Desktop/step-1.pngscreencapture -R takes the same screenshot area every timeGrab an exact rectangle of the screen with identical size each run.1 Dec 2026 - Tip
xclip -selection clipboard < ~/.ssh/id_ed25519.pubxclip puts command output on the Linux clipboardCopy a file or command output without selecting it with the mouse.1 Dec 2026 - Tip
uname -r | wl-copywl-copy is the clipboard command for a Wayland desktopPipe text to the clipboard and paste it back on Wayland.1 Dec 2026 - Tip
dir | clipPipe into clip to fill the Windows clipboard from the command lineSend output or a whole file to the clipboard without selecting.1 Dec 2026 - Tip
leaks -atExit -- ./myprogram --some-optionleaks can check a program for lost memory the moment it exits on a MacTest your own command line program for leaked allocations.1 Dec 2026 - Tip
fincore /var/lib/example/data.dbfincore shows how much of a file sits in the page cacheSee whether a file is being served from RAM or still from disk.1 Dec 2026 - Tip
file photo.jpg data.binfile reads the contents to tell you what files really areIdentify a file by its contents, whatever its extension claims.1 Dec 2026 - Tip
stty -ixonCtrl-S freezes the terminal, Ctrl-Q wakes it up againExplains why the terminal stops responding after Ctrl-S and how to stop that for good.30 Nov 2026 - Tip
softwareupdate --historysoftwareupdate lists the macOS updates your Mac already installed, from the terminalShows the names, versions and install dates of past system updates.30 Nov 2026 - Tip
Get-Content $HOME\.ssh\id_ed25519.pub | Set-ClipboardSet-Clipboard copies command output from the PowerShell terminalSends the result of any PowerShell command straight to the clipboard.30 Nov 2026 - Tip
script -r demo.recscript -r records a terminal session with timing, and script -p plays it backRecords a terminal session so you can replay it later at its original speed.30 Nov 2026 - Tip
^[[1;5CCtrl-V shows the code a key really sends to your terminalShows the raw escape sequence of any key, which you need for key bindings.30 Nov 2026 - Tip
tmux kill-servertmux kill-server ends every tmux session at onceStops the tmux server and everything running inside it.30 Nov 2026 - Tip
Ctrl-b [A in tmux copy mode adds a selection to what you already copiedCollects text from several places into one paste buffer.30 Nov 2026 - Tip
cd /Users/me/Downloads/Old\ Projects\ 2024Drag a file from Finder into Terminal to type its full pathPuts the complete, escaped path of a Finder item on your command line.30 Nov 2026 - Tip
printf '\033]0;%s\007' "deploy running"One printf line sets the title of your terminal tabNames a terminal tab or window from the command line or from a script.30 Nov 2026 - Tip
RemoteCommand tmux new -A -s mainRemoteCommand in ssh_config runs a command every time you connectLand in the same remote session or folder automatically when you open SSH.30 Nov 2026 - Tip
tmux new -s scratch \; set destroy-unattached onSet destroy-unattached on makes a tmux session vanish when you detachCleans up throwaway sessions as soon as you leave them.30 Nov 2026 - Tip
set -g pane-border-lines heavyset -g pane-border-lines heavy makes tmux pane borders easier to seeDraws thicker pane borders and points arrows at the active pane.30 Nov 2026 - Tip
Ctrl-o # runs make, then shows the next history lineCtrl-o reruns a sequence of bash commands from your historyReplay a few commands in a row from history, one keypress each.30 Nov 2026 - Tip
trash old-notes.txt build/The trash command in the macOS terminal moves files to the Trash, not into oblivionDeletes from the command line in a way you can still undo from Finder.30 Nov 2026 - Tip
Alt+Shift+Plus new pane to the right (vertical split)Alt+Shift+Plus and Alt+Shift+Minus split Windows Terminal into panesPuts two or more shells side by side in one Windows Terminal tab.30 Nov 2026 - Tip
man -k checksumman -k searches every man page description in your terminalFinds the command you need when you only know what it should do.30 Nov 2026 - Tip
clear && printf '\033[3J'Command-K in Mac Terminal clears the scrollback, clear only hides itWipes the whole scrollback in Terminal on a Mac instead of just the visible screen.30 Nov 2026 - Tip
make 2>&1 | tmux split-window -IPiping into tmux split-window -I shows output in a new paneSends a command's output from a script into a fresh pane.30 Nov 2026 - Tip
set -g main-pane-width 60%main-pane-width sets how big the main pane in a tmux layout getsControls the size of the big pane in the main layouts.30 Nov 2026 - Tip
EDITOR=nano crontab -eVISUAL or EDITOR decides which editor crontab -e opensPicks the editor for crontab -e for one command or for good.30 Nov 2026 - Tip
lipo -archs /opt/homebrew/bin/ghlipo -archs tells you in the terminal whether a Mac program is Intel, Apple silicon or bothShows which CPU architectures a binary on your Mac contains.30 Nov 2026 - Tip
tmux new -t work -s work2tmux new -t work starts a second session that shares the windowsLets two screens look at different windows of the same session.30 Nov 2026 - Tip
tmux has-session -t "$S" 2>/dev/null && exec tmux attach -t "$S"A small shell script builds your tmux session with all windowsRecreates the same windows, panes and commands with one command.30 Nov 2026 - Tip
set -g status-right '#{?client_prefix,#[reverse] PREFIX #[noreverse],} %H:%M'Client_prefix shows in the tmux status bar when you pressed the prefixGives you a visible sign that tmux is waiting for a key.30 Nov 2026 - Tip
red=$(tput setaf 1); green=$(tput setaf 2)Tput setaf colours script output in the terminal without hard coded escapesAdds colour to script messages in a way that stays quiet on dumb terminals.30 Nov 2026 - Tip
tmux kill-pane -atmux kill-pane -a closes every pane except the one you are inClears all other panes in the window in one command.30 Nov 2026 - Tip
New-Item -ItemType File -Path $PROFILE -Force$PROFILE is the startup file of your PowerShell terminalShows where PowerShell keeps its startup script and how to create it safely.30 Nov 2026 - Tip
^ cursor on the i, press Ctrl-tCtrl-t swaps two letters you typed the wrong way round in the shellFix a typo like sl or sytemctl with one key instead of retyping.30 Nov 2026 - Tip
sed 's/^#auth/auth/' /etc/pam.d/sudo_local.template | sudo tee /etc/pam.d/sudo_localSudo_local lets you approve sudo in the Mac terminal with Touch IDUses your fingerprint for sudo, in a way that survives macOS updates.30 Nov 2026 - Tip
tmux select-pane -d -t 2tmux select-pane -d stops a pane from taking your typingProtects a pane, such as a running job, from stray keystrokes.30 Nov 2026 - Tip
osascript -e 'display notification "Backup finished" with title "Terminal" sound name "Glass"'osascript display notification tells you when a terminal job is doneShows a macOS notification from a script or after a long command.30 Nov 2026 - Tip
Ctrl-b ECtrl-b E spreads tmux panes out evenly without changing the layoutEvens out pane sizes while keeping your own arrangement.30 Nov 2026 - Tip
mkdir -p ~/.config/tmuxTmux reads its config from ~/.config/tmux/tmux.conf tooLets you keep the tmux config with your other dotfiles.30 Nov 2026 - Tip
SYSTEMD_COLORS=1 journalctl -b -p warning | less -RSYSTEMD_COLORS=1 keeps journalctl colors when you pipe the outputKeep the red errors and yellow warnings when journalctl output goes through grep or less.30 Nov 2026 - Tip
bind S command-prompt -p 'new session:' 'new-session -A -s "%%"'A tmux key that asks for a name and creates a new sessionCreates and switches to a named session from inside tmux.30 Nov 2026 - Tip
Ctrl-b ~Ctrl-b ~ shows the tmux messages you missedReopens status bar messages that disappeared too fast.30 Nov 2026 - Tip
xattr -d com.apple.quarantine ./toolxattr -d com.apple.quarantine clears the download flag on a file in the terminalRemoves the quarantine mark that makes Gatekeeper block a downloaded tool.30 Nov 2026 - Tip
SYSTEMD_LESS=FRXMK journalctl -u nginxSYSTEMD_LESS changes how the journalctl pager behavesMake the journalctl pager wrap long lines instead of cutting them off at the screen edge.30 Nov 2026 - Tip
tmux attach -r -t demotmux attach -r lets someone watch a session without typing in itAttaches a client that can see a session but not change it.30 Nov 2026 - Tip
tmux split-window -f -v -l 10tmux split-window -f adds a pane across the whole windowAdds a log strip under all your panes instead of under just one.30 Nov 2026 - Tip
setw -g window-status-current-style 'bg=yellow,fg=black,bold'window-status-current-style highlights the active tmux windowMakes the current window stand out in the status bar.30 Nov 2026 - Tip
tmux list-clientstmux list-clients shows who is attached to which sessionLists every terminal connected to tmux, with session and size.30 Nov 2026 - Tip
Ctrl-b .Ctrl-b . moves a tmux window to another number or sessionMoves the current window to a new index or another session.30 Nov 2026 - Tip
Alt-b back one wordAlt-b and Alt-f move through a shell command one word at a timeJump over words on the command line instead of holding the arrow keys.30 Nov 2026 - Tip
Control-click the itemHold Option in the Finder's Control-click menu to copy a file's full pathCopy the complete path of any file or folder to paste in Terminal or a config file.30 Nov 2026 - Tip
Alt-u UPPERCASE the rest of the wordAlt-u and Alt-l fix the case of a word on the shell lineChange a word to upper, lower or title case while you type a command.30 Nov 2026 - Tip
"\e[A": history-search-backwardThe Up arrow can search bash history for what you already typedType the start of a command, press Up, and get only matching history lines.30 Nov 2026 - Tip
Ctrl-b CCtrl-b C opens a menu of every tmux option and key bindingLets you browse and change tmux options without the man page.30 Nov 2026 - Tip
sips -s format jpeg -s formatOptions 80 *.heic --out jpg/sips -s format jpeg converts HEIC photos to JPEG in the terminalTurns iPhone HEIC photos into JPEG files that every website accepts.30 Nov 2026 - Tip
[x] Use Option as Meta keyUse Option as Meta key makes Alt shortcuts work in Mac TerminalLets the Option key act as Alt for word jumps and other shell shortcuts.30 Nov 2026 - Tip
tailscale completion zsh > "${fpath[1]}/_tailscale"tailscale completion adds tab completion for every Tailscale commandLet your shell complete Tailscale subcommands and flags instead of checking the help.30 Nov 2026 - Tip
tmux split-window -e AWS_PROFILE=stagingtmux split-window -e starts a pane with its own environment variableGives one new pane an extra environment variable without touching others.30 Nov 2026 - Tip
rm old-*.logCtrl-x * expands a wildcard on the bash line before you run itSee exactly which files a glob matches, and edit the list, before pressing Enter.30 Nov 2026 - Tip
Ctrl-b Alt-nCtrl-b Alt-n jumps to the next tmux window with activityGoes straight to the window that rang a bell or printed output.30 Nov 2026 - Tip
Ctrl-b 'Ctrl-b ' jumps to tmux window 10 and up by numberReaches windows numbered above 9 without cycling through them.30 Nov 2026 - Tip
tabs -4tabs -4 makes the terminal show tab characters four columns wideChanges how wide tab characters look in your terminal for cat and less.30 Nov 2026 - Tip
ssh-keygen -c -C "work laptop 2026" -f ~/.ssh/id_ed25519ssh-keygen -c changes the comment on an SSH keyRename the label on an existing key so you can tell keys apart later.30 Nov 2026 - Tip
pmset displaysleepnowpmset displaysleepnow turns off your Mac screen from the terminalTurns the display off right away while everything keeps running.30 Nov 2026 - Tip
look recurslook finds lines that start with a word in a sorted file, right in the terminalSearches a sorted list by prefix, fast, and doubles as a spelling helper.30 Nov 2026 - Tip
set -g window-style 'fg=colour247,bg=colour236'window-style dims the tmux panes you are not working inGreys out inactive panes so the active one stands out.30 Nov 2026 - Tip
osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to not dark mode'One osascript line switches your Mac between light and dark mode from the terminalToggles macOS dark mode with a command you can bind or schedule.30 Nov 2026 - Tip
set -g copy-command 'pbcopy'set -g copy-command sends every tmux copy to your system clipboardPipes copied text to pbcopy, wl-copy or xclip automatically.30 Nov 2026 - Tip
bind -n M-Left select-pane -Lbind -n M-Left lets you switch tmux panes without the prefixMoves between panes with Alt and an arrow key.30 Nov 2026 - Tip
tmux source-file -n ~/.tmux.conftmux source-file -n checks your config for errors without applying itFinds typos in a tmux config before you load it.30 Nov 2026 - Tip
Ctrl-b mCtrl-b m marks a tmux pane so you can swap or join it laterMarks one pane as the source for swap-pane and join-pane.30 Nov 2026 - Tip
set -g pane-scrollbars modalset -g pane-scrollbars modal shows a scrollbar in tmux copy modeShows where you are in a pane's history while scrolling.30 Nov 2026 - Tip
Terminal (menu bar) > Secure Keyboard EntrySecure Keyboard Entry stops other apps from reading what you type in TerminalProtects passwords and keys you type in Terminal from keyloggers and snooping apps.30 Nov 2026 - Tip
Ctrl-b DCtrl-b D lets you detach another client from a tmux sessionKicks a forgotten connection off your session from a list.30 Nov 2026 - Tip
Match tagged tunnelTag and ssh -P give one SSH host several profilesSwitch a block of ssh_config settings on per command with a tag name.30 Nov 2026 - Tip
^ Option-click hereOption-click moves the cursor on the line in Mac TerminalPlaces the cursor exactly where you click on a long command line.30 Nov 2026 - Tip
tmux show -gv history-limittmux show -gv prints the current value of one optionChecks what an option is really set to on the running server.30 Nov 2026 - Tip
tmux attach -t main -c ~/projects/sitetmux attach -c changes the folder new tmux windows start inPoints a running session at a new project folder.30 Nov 2026 - Tip
tmux load-buffer ~/snippets/deploy.txttmux load-buffer puts a file's text in the tmux paste bufferLoads text from a file or a pipe so you can paste it anywhere.30 Nov 2026 - Tip
Ctrl-b [* in tmux copy mode searches for the word under the cursorFinds the next place a word appears without typing it.30 Nov 2026 - Tip
set -g remain-on-exit failedset -g remain-on-exit failed keeps a crashed tmux pane openLets you read the error when a pane's command fails.30 Nov 2026 - Tip
cd /var/www/uploadSftp -b runs a list of SFTP commands from a file over SSHScript uploads and downloads with sftp and stop at the first failed command.30 Nov 2026 - Tip
setw -g automatic-rename-format '#{b:pane_current_path}'automatic-rename-format names tmux windows after their folderShows the current folder instead of the program in window names.30 Nov 2026 - Tip
tmutil statustmutil status shows whether Time Machine is backing up right now, in the terminalTells you if a backup is running and how far along it is.30 Nov 2026 - Tip
set -s command-alias[100] 'rl=source-file ~/.tmux.conf'command-alias gives a tmux command a short name of your ownCreates your own shortcuts for long tmux commands at the prompt.30 Nov 2026 - Tip
cp -c ~/VMs/ubuntu.img ~/VMs/ubuntu-before-upgrade.imgcp -c copies a big file instantly on a Mac terminal using APFS clonesMakes a copy of a large file in a moment without using extra disk space.30 Nov 2026 - Tip
tmux resize-pane -x 80tmux resize-pane -x 80 gives a pane an exact widthSets a pane to a precise number of columns or a percentage.30 Nov 2026 - Tip
Set-PSReadLineKeyHandler -Chord UpArrow -Function HistorySearchBackwardHistorySearchBackward on the Up arrow in the PowerShell terminalMakes Up and Down in PowerShell return only commands that start with your text.30 Nov 2026 - Tip
tmutil comparetmutil compare shows what changed since the last Time Machine backup, in the terminalLists files that were added, changed or removed compared with a backup.30 Nov 2026 - Tip
disown -h %1disown lets a running job survive closing the terminalMarks a running background job so it keeps going after you close the shell.28 Nov 2026 - Tip
pushd /var/logpushd and popd give your shell a stack of folders to jump back toKeeps a numbered stack of folders so you can hop back and forth between them.28 Nov 2026 - Tip
PROMPT_COMMAND='history -a'PROMPT_COMMAND runs a command before every bash promptRuns a command of your choice before each prompt is shown.28 Nov 2026 - Tip
printf '%s\n' "holiday photo.jpg" "notes 2026.txt" | xargs -d '\n' -n1 echoXargs -d '\n' keeps file names with spaces in one pieceMakes xargs split its input only at newlines, so names with spaces stay whole.28 Nov 2026 - Tip
systemd-inhibit --why="Copying photos" rsync -a /mnt/user/photos/ /mnt/backup/photos/systemd-inhibit keeps a long job from being cut off by sleep or shutdownRuns a command while preventing the machine from sleeping or shutting down.28 Nov 2026 - Tip
sudo -ksudo -k forgets your cached sudo password right awayClears sudo's cached password so the next command asks for it again.28 Nov 2026 - Tip
shopt -s failglobshopt -s failglob makes bash refuse a wildcard that matches nothingMakes bash print an error and skip the command when a wildcard matches no files.28 Nov 2026 - Tip
type -a echotype -a lists everything a command name can mean in bashShows every alias, builtin, function and file behind a command name.28 Nov 2026 - Tip
ldconfig -p | grep libsslldconfig -p lists every shared library the system can findLists the shared libraries registered in the linker cache so you can search them.28 Nov 2026 - Tip
lslockslslocks shows which process holds a lock on which fileLists file locks held on the system with the process that owns each one.28 Nov 2026 - Tip
[email protected]:~$ ~CType ~C to add a port forward to a running SSH sessionOpens ssh's own command line in a live session so you can add or cancel port forwards.28 Nov 2026 - Tip
mklink /J "C:\Games\SaveData" "D:\Storage\SaveData"mklink /J makes a folder show up in a second placeCreates a directory junction so a folder appears under a second path.28 Nov 2026 - Tip
Select-String -Path C:\Temp\app.log -Pattern 'error' -Context 2,3Select-String -Context shows the lines around a matchPrints a few lines before and after every match in a text file.28 Nov 2026 - Tip
ssh-keygen -t ed25519-sk -C "laptop-key"ssh-keygen -t ed25519-sk ties an SSH key to a hardware security keyCreates an SSH key that needs your hardware security key to be used.28 Nov 2026 - Tip
shred -v -u -z ~/Documents/old-secret.txtshred overwrites a file before deleting it, but the manual has a warningOverwrites a file before deleting it, plus the manual's warning about copies and file systems.28 Nov 2026 - Tip
ssh-add -t 1h ~/.ssh/id_ed25519ssh-add -t makes an SSH key vanish from the agent after a set timeLoads an SSH key into the agent for a limited time only.28 Nov 2026 - Tip
Select-String -Pattern 'example.com' -List |Select-String -List names the files that contain a wordLists only the files in a folder tree whose text contains a pattern.28 Nov 2026 - Tip
Start-Process -FilePath "powershell" -Verb RunAsStart-Process -Verb RunAs opens an elevated program from PowerShellStarts one program with administrator rights from a normal PowerShell window.28 Nov 2026 - Tip
where /r C:\Users\Public *.logwhere /r finds a file by name from the command promptFinds files by name under a folder, or shows which copy of a program is on your PATH.28 Nov 2026 - Tip
/usr/bin/time -f "%e s elapsed, %M KB peak memory" tar czf /tmp/test.tar.gz ~/Documents/usr/bin/time -f '%e s, %M KB' shows how much memory a command neededReports elapsed time and peak memory of one command with GNU time.28 Nov 2026 - Tip
tmux swap-window -s 3 -t 1tmux swap-window -t 1 trades the places of two windowsSwaps the positions of two tmux windows.28 Nov 2026 - Tip
tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} #{pane_current_command} #{pane_current_path}'tmux list-panes -a -F lists every pane on the server with its folder and commandPrints one line per pane on the whole tmux server, in a format you choose.28 Nov 2026 - Tip
tmux new-window -atmux new-window -a opens the new window right after the current oneCreates a new tmux window directly after the current one instead of at the end.28 Nov 2026 - Tip
set -g display-time 3000set -g display-time 3000 keeps tmux messages on screen longerSets how long tmux status line messages stay on screen, in milliseconds.28 Nov 2026 - Tip
set -g focus-events onset -g focus-events on tells programs inside tmux when the window gains focusPasses terminal focus in and out events through tmux to programs running inside it.28 Nov 2026 - Tip
set -g set-clipboard onset -g set-clipboard on lets tmux copy to your terminal's clipboardLets tmux copy selected text to the clipboard of your terminal, even over SSH.28 Nov 2026 - Tip
tmux rotate-window -Dtmux rotate-window shifts every pane one place without touching the layoutMoves every pane in a tmux window to the next position while keeping the layout.28 Nov 2026 - Tip
tmux find-window 'Permission denied'tmux find-window searches window names and visible text for a wordFinds the tmux window whose name, title or visible text matches a pattern.28 Nov 2026 - Tip
tmux setw monitor-silence 30Setw monitor-silence 30 highlights a tmux window that has gone quietHighlights a tmux window in the status bar after it has printed nothing for a set time.28 Nov 2026 - Tip
set -g detach-on-destroy offset -g detach-on-destroy off moves you to another session when one endsSwitches a tmux client to another session when its session closes, instead of detaching.28 Nov 2026 - Tip
set -g set-titles onset -g set-titles on makes your terminal tab show the tmux sessionMakes the terminal tab or window title show the tmux session and window name.28 Nov 2026 - Tip
tmux -L test -f /tmp/test.conf new -s trytmux -L test starts a second, separate tmux serverRuns an independent tmux server on a named socket, separate from your normal sessions.28 Nov 2026 - Tip
if-shell 'test "$(uname)" = Darwin' 'set -g status-style bg=blue' 'set -g status-style bg=green'Tmux if-shell runs a tmux command only when a shell test passesRuns a tmux command only if a shell test succeeds, so one config works on many machines.28 Nov 2026 - Tip
sudo killall -HUP mDNSRespondersudo killall -HUP mDNSResponder flushes the macOS DNS cacheClears the cached DNS answers on a Mac with one command.28 Nov 2026 - Tip
set -g status-interval 5set -g status-interval 5 refreshes the tmux status bar more oftenSets how often tmux redraws its status line and refreshes the commands in it.28 Nov 2026 - Tip
tmux save-buffer - | wc -ltmux save-buffer – writes your last tmux copy to stdoutWrites the newest tmux copy buffer to a file or to standard output.28 Nov 2026 - Tip
set -g word-separators ' 'set -g word-separators controls where w and b stop in tmux copy modeSets which characters tmux treats as word boundaries when you move by word in copy mode.28 Nov 2026 - Tip
setw -g aggressive-resize onsetw -g aggressive-resize on sizes tmux windows per current windowSizes a tmux window to the sessions that have it as current window.28 Nov 2026 - Tip
tmux show-environment -s SSH_AUTH_SOCKtmux show-environment -s prints the session environment as shell commandsPrints a tmux session variable as a shell command, so an old pane can pick up the new value.28 Nov 2026 - Tip
set-option -wg automatic-rename offset -g automatic-rename off stops tmux renaming your windowsStops tmux from renaming windows after the program running in them.28 Nov 2026 - Tip
tmux clock-modeCtrl-b t shows a big clock and clock-mode-style sets its formatShows a large clock in a tmux pane, in 12 or 24 hour format, with or without seconds.28 Nov 2026 - Tip
mdutil -s /mdutil -E erases the Spotlight index so the Mac builds a new oneErases the Spotlight index of a volume so macOS rebuilds it from scratch.28 Nov 2026 - Tip
dscacheutil -q host -a name example.comdscacheutil -q host looks up a host name on your MacQueries the Mac's Directory Service cache for a host name or an IP address.28 Nov 2026 - Tip
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUEDSDontWriteNetworkStores stops Finder from reading .DS_Store files on SMB sharesMakes Finder skip .DS_Store files on SMB shares, which can speed up browsing.28 Nov 2026 - Tip
footprint Safarifootprint shows what one Mac process's memory is made ofBreaks down the memory footprint of a process into categories, with optional sampling.28 Nov 2026 - Tip
sudo fs_usage -w -f filesys Mailsudo fs_usage shows which files a Mac app is reading and writingLists the file system calls of one app live, so you see which files it touches.28 Nov 2026 - Tip
lpstat -olpstat -o shows what is stuck in the Mac print queueLists the queued print jobs and printer status from the Mac terminal.28 Nov 2026 - Tip
memory_pressure -S -l warn -s 20memory_pressure -S simulates low memory on your MacApplies real or simulated low-memory states to a Mac, for a set number of seconds.28 Nov 2026 - Tip
mkfile -v 100m /tmp/test-100m.binmkfile makes a test file of an exact size on a MacCreates a file of an exact size, optionally without allocating the disk space.28 Nov 2026 - Tip
tmux new-window -S -n logs 'tail -f /var/log/syslog'tmux new-window -S -n logs jumps to a named window or creates itSwitches to a tmux window with the given name if it exists, and creates it if it does not.28 Nov 2026 - Tip
open -n -a Calculatoropen -n starts a second copy of a Mac app that is already runningLaunches another instance of an app that is already running.28 Nov 2026 - Tip
pmset -g battpmset -g batt prints your MacBook battery state in TerminalPrints the status of the batteries and power sources of a MacBook from Terminal.28 Nov 2026 - Tip
sample Safari 5 -file ~/Desktop/safari-sample.txtsample shows what a frozen Mac app is busy doingRecords where a running or frozen app spends its time, as a text call tree.28 Nov 2026 - Tip
ssh-add --apple-use-keychain ~/.ssh/id_ed25519ssh-add --apple-use-keychain stores your SSH key passphrase in the macOS keychainSaves an SSH key passphrase in the macOS keychain, so it is not asked again.28 Nov 2026 - Tip
taskpolicy -b ./convert-all.shtaskpolicy -b runs a heavy command at background priority on your MacRuns a command or an already running process at low background priority.28 Nov 2026 - Tip
top -o mem -n 10top -o mem lists the Mac processes with the biggest memory footprintShows the processes with the biggest memory footprint first, in a fixed-size list.28 Nov 2026 - Tip
vm_statvm_stat prints Mac memory in pages, so check the page size firstPrints macOS memory statistics in pages, with the page size in the header.28 Nov 2026 - Tip
dot_clean -m /Volumes/USBSTICKdot_clean -m removes the ._ files a Mac leaves on USB sticks and sharesCleans up the ._ metadata files macOS leaves on USB sticks and shared folders.28 Nov 2026 - Tip
hdiutil compact ~/Documents/Projects.sparsebundlehdiutil compact gives back the space a sparse bundle no longer usesShrinks a sparse bundle disk image after you deleted files inside it.28 Nov 2026 - Tip
export HOMEBREW_AUTO_UPDATE_SECS=604800HOMEBREW_AUTO_UPDATE_SECS stops brew install from updating every timeSets how often Homebrew updates itself before install and upgrade commands.28 Nov 2026 - Tip
ipconfig getpacket en0ipconfig getpacket shows the DHCP answer your Mac gotPrints the address, router, DNS servers and lease time your Mac got from DHCP.28 Nov 2026 - Tip
killall -s Finderkillall -s shows which processes it would kill before it doesPreviews which processes a killall command would hit without sending any signal.28 Nov 2026 - Tip
mdfind -onlyin ~/Documents "kMDItemContentType == 'com.adobe.pdf'"mdfind with a kMDItem query finds files by metadata, not by nameFinds files by one metadata field, such as content type or author, from Terminal.28 Nov 2026 - Tip
mdfind -live -onlyin ~/Downloads invoicemdfind -live keeps a Spotlight search running in the terminalKeeps an mdfind search open and updates the match count as files change.28 Nov 2026 - Tip
Caps Lock key: ControlTurn Caps Lock into an extra Control key on your MacMakes the Caps Lock key work as Control, handy for terminal shortcuts.28 Nov 2026 - Tip
nettop -P -d -t externalnettop -P shows which app on your Mac is using the networkLists every process with its live network traffic, one line per app.28 Nov 2026 - Tip
networksetup -listlocationsnetwork locations give your Mac a second set of network settingsSaves separate sets of network settings and switches between them in one step.28 Nov 2026 - Tip
open -a Preview *.pngopen -a opens a file in the app you pick, not the default oneOpens files in a specific app from the terminal, without changing your default app.28 Nov 2026 - Tip
sudo sh -c 'echo /opt/mytools/bin > /etc/paths.d/mytools'A file in /etc/paths.d adds a folder to PATH for every Mac userAdds a folder to the command search path for all users on a Mac.28 Nov 2026 - Tip
pmset -g log | grep -i wakepmset -g log shows when your Mac slept and woke, and whyLists the recent sleep and wake events of your Mac to explain battery drain.28 Nov 2026 - Tip
sudo pmset repeat wakeorpoweron MTWRF 07:45:00 sleep MTWRFSU 23:30:00Pmset repeat wakes or starts your Mac on a scheduleSchedules your Mac to wake, start, sleep or shut down at fixed times.28 Nov 2026 - Tip
scutil --nc listscutil --nc starts and stops a Mac VPN connection from the terminalConnects, checks and disconnects a macOS VPN service from Terminal or a script.28 Nov 2026 - Tip
shortcuts sign --mode people-who-know-me --input "Share me.shortcut" --output "Share me signed.shortcut"shortcuts sign turns an exported shortcut into a file other people can importSigns an exported shortcut file in Terminal so other people can import it.28 Nov 2026 - Tip
softwareupdate --list-full-installerssoftwareupdate --fetch-full-installer downloads a full macOS installerDownloads a chosen macOS installer version from Terminal instead of the App Store.28 Nov 2026 - Tip
softwareupdate --install-rosettasoftwareupdate --install-rosetta installs Rosetta without opening an Intel appInstalls Rosetta for Intel apps from Terminal, ready for scripts on a new Mac.28 Nov 2026 - Tip
spctl --assess --verbose /Applications/SomeApp.appspctl --assess asks Gatekeeper about an app before you open itAsks Gatekeeper whether an app or installer would be allowed, without opening it.28 Nov 2026 - Tip
tccutil reset Camera com.example.apptccutil reset makes an app ask again for camera or microphone accessClears an app's saved privacy permission so macOS asks you again next time.28 Nov 2026 - Tip
Command-Up Arrow jump to previous markCommand-Up Arrow in Mac Terminal jumps back to your previous promptJumps between command prompts in Terminal and selects one command's output.28 Nov 2026 - Tip
tmutil destinationinfotmutil destinationinfo lists every Time Machine backup disk and its IDShows which backup disks Time Machine uses and which one got the latest backup.28 Nov 2026 - Tip
sudo tmutil inheritbackup "/Volumes/timemachine/Old MacBook.sparsebundle"Tmutil inheritbackup lets a new Mac carry on with the old Mac's Time Machine backupLets a new or repaired Mac keep adding to its old Time Machine backup.28 Nov 2026 - Tip
sudo tmutil latestbackupTmutil latestbackup tells you when Time Machine last finished a backupShows the date of your newest Time Machine backup from Terminal.28 Nov 2026 - Tip
tmutil listlocalsnapshots /tmutil listlocalsnapshots shows the Time Machine snapshots stored on your Mac itselfLists the hidden hourly Time Machine snapshots on your Mac's own disk.28 Nov 2026 - Tip
sudo tmutil setdestination -a -p smb://[email protected]/timemachineTmutil setdestination -a -p adds a network share as a Time Machine disk from TerminalAdds an SMB share as a Time Machine backup disk with one Terminal command.28 Nov 2026 - Tip
tmutil startbackup --auto --blocktmutil startbackup --block runs a Time Machine backup and waits until it is doneStarts a Time Machine backup from Terminal and waits until it has finished.28 Nov 2026 - Tip
xcode-select --installxcode-select --install gets the Command Line Tools without the full XcodeInstalls Apple's compilers and build tools for the terminal without the full Xcode app.28 Nov 2026 - Tip
autoload -Uz compinitCompinit in ~/.zshrc turns on Tab completion for brew commandsMakes Tab complete Homebrew commands and installed tools in zsh.28 Nov 2026 - Tip
afconvert -f m4af -d aac -b 256000 recording.wav recording.m4aafconvert converts audio files on a Mac without extra softwareConverts audio, for example WAV to AAC, with a converter that already comes with macOS.28 Nov 2026 - Tip
echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> ~/.zprofileBrew shellenv in ~/.zprofile puts Homebrew on your PATHMakes Homebrew commands and man pages work in every new zsh login shell.28 Nov 2026 - Tip
chflags hidden ~/Desktop/scratchchflags hidden hides a file from Finder without renaming itHides a file or folder from Finder and open dialogs while keeping its name.28 Nov 2026 - Tip
chsh -s /bin/zshchsh -s /bin/zsh switches your Mac account to zsh and ends the bash noticeChanges your account's login shell to zsh, or quiets the notice if you stay on bash.28 Nov 2026 - Tip
codesign -dv --verbose=4 /Applications/SomeApp.appcodesign -dv shows who signed an app on your MacShows the developer and certificate chain behind an app's code signature.28 Nov 2026 - Tip
cupsfilter notes.txt > notes.pdfcupsfilter turns a text file into a PDF from the Mac terminalConverts a plain text file to a PDF from the terminal, using the Mac's print system.28 Nov 2026 - Tip
defaults read > ~/before.txtDiff two defaults read dumps to find the key behind a Mac settingShows which preference key a setting changes, so you can script it later.28 Nov 2026 - Tip
diskutil activitydiskutil activity shows live what happens to disks on your MacShows live when disks appear, mount, unmount or eject on your Mac.28 Nov 2026 - Tip
diskutil eject disk4diskutil eject takes every volume of a disk offline before you pull the cableUnmounts every volume on a disk and takes it offline, ready to unplug.28 Nov 2026 - Tip
diskutil info /diskutil info prints everything macOS knows about one disk or volumeShows the file system, identifier and space of any disk or volume on your Mac.28 Nov 2026 - Tip
tmux clear-historytmux clear-history wipes the scrollback of a paneDeletes the scrollback of a tmux pane so copy mode starts fresh.27 Nov 2026 - Tip
tmux link-window -s work:logs -t home:tmux link-window shows the same window in two sessionsPuts one running tmux window in a second session, without starting it twice.27 Nov 2026 - Tip
set -g pane-border-status topset -g pane-border-status top puts a label on every tmux paneShows a label with a title or the running command in the border of every tmux pane.27 Nov 2026 - Tip
Set-PSReadLineOption -PredictionViewStyle ListViewPress F2 in PowerShell to see command predictions as a listShows PowerShell's history-based command suggestions as a pick list instead of grey text.27 Nov 2026 - Tip
wt -w _quakewt -w _quake drops a Windows Terminal window down from the top of the screenOpens a Windows Terminal window that slides down from the top and hides again on a key.27 Nov 2026 - Tip
Ctrl-U # cut from the cursor to the start of the lineCtrl-U cuts the line you are typing and Ctrl-Y pastes it backParks a half-typed command so you can run another one first and paste it back.27 Nov 2026 - Tip
Ctrl-_ # undo the last editCtrl-_ undoes your last edit on the bash command lineTakes back your last change on the command line, one step per press.27 Nov 2026 - Tip
set completion-ignore-case oncompletion-ignore-case in ~/.inputrc makes Tab completion ignore upper and lower caseLets Tab complete Documents when you type doc, and lists every match at once.27 Nov 2026 - Tip
PROMPT_DIRTRIM=2PROMPT_DIRTRIM=2 shortens a long path in your bash promptKeeps only the last few folders of the current path in your prompt.27 Nov 2026 - Tip
Alt-Ctrl-e # or press Esc, then Ctrl-eAlt-Ctrl-e expands variables, aliases and !! on the bash line before you press EnterShows on the prompt what a command becomes once bash fills in variables and aliases.27 Nov 2026 - Tip
shopt -s autocdshopt -s autocd lets you change folder by typing only its nameMoves into a folder when you type its name, without typing cd.27 Nov 2026 - Tip
Ctrl-x Ctrl-eCtrl-x Ctrl-e opens a long bash command in your editorOpens the command you are typing in your text editor and runs it when you save.27 Nov 2026 - Tip
/terminal-setup/terminal-setup makes Shift+Enter add a new line in Claude Code inside VS CodeAdds a Shift+Enter newline binding to terminals where Shift+Enter sends your prompt instead.27 Nov 2026 - Tip
sudo /Applications/Install\ macOS\ 27\ Golden\ Gate.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolumeCreateinstallmedia turns a USB stick into a bootable macOS installerMakes a USB drive that can boot a Mac and install macOS from it.27 Nov 2026 - Tip
Enter ~ .Type ~. to close a frozen SSH sessionCloses a hanging SSH session from your own keyboard without closing the terminal.27 Nov 2026 - Tip
shasum -a 256 ~/Downloads/debian-13.isoshasum -a 256 checks a download on macOS against its published checksumCalculates the SHA-256 of a file on a Mac, or checks it against a list of checksums.26 Nov 2026 - Tip
system_profiler SPHardwareDataTypesystem_profiler SPHardwareDataType prints a macOS machine's model, chip and serialShows the model, chip, memory and serial number of a Mac from the terminal.26 Nov 2026 - Tip
tmux respawn-pane -ktmux respawn-pane -k restarts the command in a pane without closing itRestarts a pane's program in place, with the same layout and starting command.26 Nov 2026 - Tip
pstree -ppstree -p shows which process started which on Linux, with PIDsDraws the running processes as a tree, so you see parents, children and their PIDs.26 Nov 2026 - Tip
pkgutil --pkgspkgutil --files shows everything a macOS installer package put on your diskLists what a .pkg installer added to your Mac, so you can see where its files went.26 Nov 2026 - Tip
tmux pipe-pane -o 'cat >>~/output.#I-#P'tmux pipe-pane -o writes everything a pane prints to a fileSaves all output of a tmux pane to a log file, switched on and off with one key.26 Nov 2026 - Tip
shortcuts run "Combine Images" -i ~/Desktop/*.jpg -o ~/Desktop/combined.pngshortcuts run starts a Mac shortcut from TerminalRuns your Shortcuts app shortcuts from the command line, with files as input.25 Nov 2026 - Tip
afplay /System/Library/Sounds/Glass.aiffafplay plays a sound file from the terminal when a long job endsPlays an audio file through the default output, so a long command can tell you it has finished.25 Nov 2026 - Tip
hdiutil create -volname "Project" -srcfolder ~/Documents/project project.dmghdiutil create -srcfolder packs a folder into a .dmg disk imageCreates a compressed disk image from a folder, ready to share, mount or archive.25 Nov 2026 - Tip
say -v '?'say makes your Mac read text aloud or save it as an audio fileReads text out loud with a system voice, or writes the speech to an audio file.24 Nov 2026 - Tip
sw_verssw_vers prints your macOS version and build numberPrints the macOS product name, version and build number, or just one of them for scripts.24 Nov 2026 - Tip
xattr -l ~/Downloads/app.dmgxattr -l shows the hidden extra data that macOS attaches to a fileLists the extended attributes of a file, including the quarantine flag that macOS sets on downloads.24 Nov 2026 - Tip
tmux has-session -t work 2>/dev/null || tmux new -d -s worktmux has-session tells a script whether a session already existsExits with success when the named session exists and with failure when it does not.21 Nov 2026 - Tip
Ctrl-b ?Ctrl-b ? shows every tmux key binding inside tmuxOpens a searchable list of all key bindings, including the ones you added yourself.21 Nov 2026 - Tip
Ctrl-b PageUpCtrl-b PageUp scrolls tmux back without any setupEnters scrollback straight away and moves one page up, with no mouse and no extra config.21 Nov 2026 - Tip
bind -r L resize-pane -R 5bind -r makes a tmux key repeat without pressing the prefix againLets you press a key several times after one prefix, which suits resizing and moving.21 Nov 2026 - Tip
Enter # copy and leave copy modeSpace starts a selection in tmux copy mode and Enter copies itSelects text in copy mode with the keyboard and copies it into tmux's paste buffer.21 Nov 2026 - Tip
Ctrl-b 0Ctrl-b and a digit jumps straight to that tmux windowSwitches to a window by its number, shown in the status bar, with two key presses.21 Nov 2026 - Tip
bind | split-window -hbind | and – to split tmux panes with keys that make senseReplaces the default split keys with a pipe for side by side and a dash for stacked.21 Nov 2026 - Tip
Ctrl-b ( # previous sessionCtrl-b ( and Ctrl-b ) switch between tmux sessionsMoves to the previous or next tmux session without detaching first.21 Nov 2026 - Tip
set -s escape-time 10set -s escape-time 10 stops the Escape lag in Vim inside tmuxCuts the delay tmux adds after Escape, so Vim and similar editors react at once.21 Nov 2026 - Tip
tmux join-pane -s 2 # take window 2 and put it into this windowtmux join-pane moves a pane from another window into this onePulls a pane out of another window and places it next to the pane you are in.21 Nov 2026 - Tip
Ctrl-b Alt-1 # even-horizontalCtrl-b Alt-1 to Alt-5 pick one tmux pane layout directlyApplies a fixed pane layout straight away, with the number of the layout as the key.21 Nov 2026 - Tip
set -g mode-keys viset -g mode-keys vi gives tmux copy mode vi keysMakes copy mode use vi movement and selection keys instead of the emacs style ones.21 Nov 2026 - Tip
setw -g monitor-activity onsetw -g monitor-activity on flags tmux windows that print somethingMarks a window in the status bar when something new appears in it while you look elsewhere.21 Nov 2026 - Tip
Ctrl-b SpaceCtrl-b Space cycles through the tmux pane layoutsRearranges the panes of the current window into the next of tmux's five built-in layouts.21 Nov 2026 - Tip
Ctrl-b n # next windowCtrl-b n and Ctrl-b p walk through your tmux windowsMoves to the next or the previous window in the session with a single key after the prefix.21 Nov 2026 - Tip
Ctrl-b ,Ctrl-b , renames the tmux window you are inGives the current tmux window a name you choose, so the status bar tells you what is running where.21 Nov 2026 - Tip
tmux attach -d -t worktmux attach -d takes over a session from another screenAttaches to a session and disconnects every other client that is still attached to it.21 Nov 2026 - Tip
set -g prefix C-aset -g prefix C-a moves the tmux prefix to a closer keyChanges the tmux prefix key from Ctrl-b to Ctrl-a, which is easier to reach.21 Nov 2026 - Tip
Ctrl-b =Ctrl-b = lists the last things you copied in tmuxShows every paste buffer tmux holds, so you can paste an older copy instead of the newest.21 Nov 2026 - Tip
Ctrl-b sCtrl-b s lists your tmux sessions and lets you pick oneOpens a list of all sessions to choose from, with a live preview of each.21 Nov 2026 - Tip
Ctrl-b :Ctrl-b : opens the tmux command prompt for any tmux commandLets you run any tmux command from inside tmux, without leaving the session.21 Nov 2026 - Tip
set -g default-terminal "tmux-256color"set -g default-terminal tmux-256color fixes broken colours in tmuxTells programs inside tmux the right terminal type, so colours and keys work as expected.21 Nov 2026 - Tip
Ctrl-b dCtrl-b d detaches from tmux and leaves everything runningLeaves the tmux session without stopping anything in it, so you can come back later.21 Nov 2026 - Tip
tmux display-message -p '#S' # session nametmux display-message -p prints facts like the session namePrints a tmux format such as the session name or pane path to the terminal, for use in scripts.21 Nov 2026 - Tip
Ctrl-b xCtrl-b x closes the tmux pane you are in, after a confirmationCloses only the current pane, asking first, and leaves the rest of the window alone.21 Nov 2026 - Tip
Ctrl-b &Ctrl-b & closes a whole tmux window after one confirmationCloses the current tmux window and every pane in it, but asks first.21 Nov 2026 - Tip
Ctrl-b ;Ctrl-b ; jumps back to the tmux pane you used beforeToggles between the current pane and the one you were in just before.21 Nov 2026 - Tip
softwareupdate --listsoftwareupdate --list shows pending macOS updates without opening SettingsLists the macOS updates that are waiting for you, straight from the terminal.18 Nov 2026 - Tip
cat ~/.ssh/id_ed25519.pub | pbcopyPbcopy puts the output of any command on your Mac clipboardSends the output of a terminal command straight to the clipboard, so you can paste it anywhere.18 Nov 2026 - Tip
systemctl --failedsystemctl --failed lists every service that did not startLists every service that failed to start, so you know after a reboot if everything came back.17 Nov 2026 - Tip
tmux list-keys -T prefix | grep split-windowtmux list-keys | grep finds the binding you forgotSearches all tmux key bindings from the shell, including the ones you added yourself.29 Sep 2026 - Tip
set -g renumber-windows onset -g renumber-windows on closes the gap when you close a windowRenumbers tmux windows automatically so there is no gap after one is closed.25 Sep 2026 - Tip
Ctrl-b Ctrl-Left # 1 cellCtrl-b Alt-arrow resizes a tmux pane five cells at a timeResizes the active tmux pane in steps of five cells with the Alt and arrow keys.22 Sep 2026 - Tip
plutil -p ~/Library/Preferences/com.apple.finder.plistplutil -p prints a plist in a readable wayPrints a macOS preferences file as readable text.20 Sep 2026 - Tip
Ctrl-b l # last windowCtrl-b l jumps back to the window you were just inToggles between the current and the previous tmux window, like alt-tab for windows.18 Sep 2026 - Tip
set -g status-position topset -g status-position top moves the tmux status bar to the topPuts the tmux status bar at the top of the screen instead of the bottom.14 Sep 2026 - Tip
mdls -name kMDItemWhereFroms ~/Downloads/example.pdfmdls -name kMDItemWhereFroms tells you where a download came fromShows the web address a downloaded file came from.14 Sep 2026 - Tip
sips -Z 1600 photo.jpg --out photo-small.jpgsips -Z shrinks photos from the terminalShrinks images to a maximum size from the terminal without opening an editor.8 Sep 2026 - Tip
select-layout tiledTmux select-layout tidies a mess of panes in one commandRearranges all panes in a tmux window into an even grid or evenly sized rows.7 Sep 2026 - Tip
tmux capture-pane -p -S -3000 > build.logtmux capture-pane -p dumps a pane's scrollback to a fileSaves what a tmux pane shows, including its history, to a text file or the terminal.30 Aug 2026 - Tip
open -R ~/Downloads/report.pdfopen -R reveals a file in Finder instead of opening itShows a file selected in Finder instead of opening it.28 Aug 2026 - Tip
/error # search forward for 'error'In tmux copy mode, / searches forward and ? searches backwardFinds text in a tmux pane's scrollback after Ctrl-b [, with n for the next match.27 Aug 2026 - Tip
Ctrl-b w # sessions and windowsCtrl-b w shows every window of every session as a treeOpens a list of all tmux sessions and windows with a preview, so you can jump to any of them.23 Aug 2026 - Tip
cat ~/.ssh/id_ed25519.pub | pbcopyPbcopy and pbpaste connect the terminal to your clipboardPipes terminal output to your clipboard and pastes clipboard text into commands.22 Aug 2026 - Tip
Ctrl-b $Ctrl-b $ renames the tmux session you are inGives the current tmux session a clearer name without restarting it.19 Aug 2026 - Tip
tmux kill-session -a -t worktmux kill-session -a closes every session except the one you nameKills all tmux sessions apart from the one you keep, for a quick clean-up.15 Aug 2026 - Tip
setw synchronize-panes onsetw synchronize-panes on types into every pane at onceSends everything you type to all panes in the tmux window, handy for the same command on several servers.12 Aug 2026 - Tip
qlmanage -p report.pdfqlmanage -p opens Quick Look from the terminalOpens the Quick Look preview of a file straight from the terminal.12 Aug 2026 - Tip
set -g base-index 1set -g base-index 1 makes window numbers match the keyboard rowStarts numbering tmux windows at 1, so the first window sits under the 1 key.8 Aug 2026 - Tip
bind | split-window -h -c "#{pane_current_path}"Open new tmux panes in the folder you are already inMakes tmux splits and new windows start in the current pane's directory instead of your home folder.4 Aug 2026 - Tip
bind r source-file ~/.tmux.conf \; display-message "Reloaded"bind r to reload your tmux config without restarting anythingAdds a key that re-reads ~/.tmux.conf inside a running tmux session.1 Aug 2026 - Tip
tmutil addexclusion ~/projects/site/node_modulestmutil addexclusion keeps node_modules out of Time MachineTells Time Machine to skip a folder so it stops backing up files you can rebuild.28 Jul 2026 - Tip
set -g history-limit 50000set -g history-limit 50000 gives every pane a much longer scrollbackRaises how many lines each tmux pane remembers, so long output is still there when you scroll back.28 Jul 2026 - Tip
set -g mouse onset -g mouse on lets you click panes, drag borders and scrollTurns on mouse support in tmux, so clicking selects panes and the wheel scrolls the history.24 Jul 2026 - Tip
Ctrl-b qCtrl-b q numbers your panes so you can jump to one with a digitShows a big number on every tmux pane for a moment, and pressing a digit selects that pane.21 Jul 2026 - Tip
softwareupdate --listsoftwareupdate --list checks for macOS updates without opening SettingsLists the updates Apple has ready for your Mac, from the terminal.21 Jul 2026 - Tip
Ctrl-b { # swap with the previous paneCtrl-b { and Ctrl-b } swap the active pane with its neighbourMoves the active tmux pane one place up or down in the layout without closing anything.17 Jul 2026 - Tip
networksetup -listallnetworkservicesSet DNS servers per network service with networksetupChanges the DNS servers of a network connection from the terminal, and resets them.14 Jul 2026 - Tip
Ctrl-b !Ctrl-b ! turns a cramped pane into a window of its ownMoves the active tmux pane out of the split layout into a new window.13 Jul 2026 - Tip
Ctrl-b zCtrl-b z zooms one pane to the whole window and brings the others backMakes the active tmux pane fill the whole window, and a second press restores the layout.9 Jul 2026 - Tip
tmux ls -F '#{session_name}: #{session_windows} windows'tmux ls -F prints sessions the way a script wants themLists tmux sessions in a format you choose, for example only the name and window count.6 Jul 2026 - Tip
screencapture -o -w ~/Desktop/settings.pngscreencapture -o -w grabs a window without the drop shadowCaptures one window as a clean image without the shadow around it.6 Jul 2026 - Tip
tmux new -As worktmux new -As work attaches to a session or creates it, one command for bothAttaches to the tmux session you name, or creates it when it does not exist yet.2 Jul 2026 - Tip
screencapture -T 5 ~/Desktop/menu.pngscreencapture -T 5 takes a screenshot after a delayTakes a screenshot after a few seconds so you can open menus first.28 Jun 2026 - Tip
mdutil -s /mdutil -s tells you if Spotlight is indexing a volumeShows whether Spotlight indexing is on for a disk.20 Jun 2026 - Tip
echo '[{"n":"a","up":true},{"n":"b","up":false}]' | jq -r '.[] | select(.up) | .n'Jq select() filters JSON in the terminal by a field valueKeeps only the JSON items that match a condition and prints one field.12 Jun 2026 - Tip
mdfind -name invoice -onlyin ~/Documentsmdfind -name searches by file name from the terminal, using SpotlightFinds files by name using the Spotlight index, much faster than walking folders.12 Jun 2026 - Tip
pmset -g assertionspmset -g assertions shows what keeps your Mac awakeLists which programs are stopping your Mac from going to sleep.5 Jun 2026 - Tip
sort -u list.txt | sponge list.txtSponge lets a terminal pipeline write back to its own input fileWrites a pipeline's result back to the file it was reading from.22 Apr 2026 - Tip
printf '%s\n' alpha beta gamma | paste -sd, -Paste -sd, joins lines into one comma separated terminal lineJoins every input line into one line with a chosen separator.21 Apr 2026 - Tip
comm -23 <(sort old.txt) <(sort new.txt)comm -23 lists lines only in one file, a terminal set differencePrints the lines that exist in the first sorted file but not in the second.21 Apr 2026 - Tip
tail -f /var/log/syslog | grep --line-buffered ERROR | cut -c1-100Grep --line-buffered keeps a terminal pipe from stallingMakes grep print each match immediately when it feeds another command.20 Apr 2026 - Tip
stty saneReset and stty sane repair a terminal that shows garbageRestores a terminal that was scrambled by binary output.20 Apr 2026 - Tip
read -r rows cols <<< "$(stty size)"Stty size gives scripts the rows and columns of your terminalPrints the number of rows and columns of the current terminal window.20 Apr 2026 - Tip
ps aux | less -SLess -S stops long lines wrapping in the terminalKeeps wide output on one line per row and lets you scroll sideways.19 Apr 2026 - Tip
sudo apt install moreutilsTs from moreutils puts a time stamp in front of each terminal lineAdds a time to every line of command output, for slow-step hunting.19 Apr 2026 - Tip
script -q -a session.logscript -a session.log records everything in your terminal to a fileSaves a full terminal session, input and output, to a text file.15 Apr 2026 - Tip
defaults write com.apple.screencapture location ~/Screenshotsdefaults write com.apple.screencapture location moves macos screenshots to a folderChanges the folder where macOS saves screenshots with one preference command.4 Mar 2026
Python13
- Tip
python3 -m platformpython -m platform tells you which OS and CPU a machine hasPrint the operating system, kernel and architecture of a machine in one command.30 Nov 2026 - Tip
echo 'dXNlcjpwYXNz' | python3 -m base64 -dPython -m base64 -d decodes base64 the same way on every systemEncode or decode base64 from the terminal without worrying which base64 tool is installed.30 Nov 2026 - Tip
python3 -u worker.py | tee worker.logpython -u shows print output right away in Docker and pipesStop print output from showing up late, or not at all, in containers and pipes.30 Nov 2026 - Tip
import json, os, re, sysPYTHONSTARTUP loads your own helpers into every Python promptRun a file of imports and helpers each time you open the interactive Python prompt.30 Nov 2026 - Tip
python3 -m gzip --best access.log # writes access.log.gz, keeps access.logpython -m gzip compresses a file and keeps the originalCompress or decompress a gzip file with Python when you want the source kept.30 Nov 2026 - Tip
printf '12.5\n3\n4.25\n' | python3 -c 'import sys; print(sum(float(l) for l in sys.stdin if l.strip()))'A python -c one-liner adds up a column of numbers from a pipeTotal a list of numbers from another command without awk or a spreadsheet.30 Nov 2026 - Tip
readlink -f /usr/bin/python3readlink -f follows every symlink and prints the real pathResolves a chain of symlinks and prints the real absolute path of the target.28 Nov 2026 - Tip
python3 -m venv --prompt . .venvpython -m venv --prompt . shows the project name instead of (.venv)Shows the project name instead of .venv in your shell prompt when a venv is active.27 Nov 2026 - Tip
python3 -m random pizza sushi pasta "leftovers again"python -m random picks a winner, a number or a dice roll from the terminalPicks a random word, whole number or decimal straight from the terminal, no script needed.27 Nov 2026 - Tip
python -m uuidpython -m uuid prints a fresh UUID without writing any codeGenerates a random UUID, or a name-based one, straight from the command line on Python 3.12 or newer.25 Nov 2026 - Tip
python3 -m calendar -m 4 2027python -m calendar prints a calendar in your terminalPrints a text calendar for a year or month without installing anything.24 Nov 2026 - Tip
python3 -m pydoc -bpython -m pydoc -b opens the Python docs of your own installStarts a local documentation server for every installed module and opens it in your browser.24 Nov 2026 - Tip
curl -s https://example.com/api | python3 -m json.toolpython3 -m json.tool makes ugly JSON readable in one pipeTakes messy one-line JSON and prints it indented, so you can read it and spot typos.1 Nov 2026
Storage9
- Tip
#rsync -av --delete /srv/media/ /mnt/backup/media/Alt-# comments out the bash line and saves it in historyPark a half-written command in history without running it.30 Nov 2026 - Tip
open x-man-page://rsyncopen x-man-page:// shows a man page in its own Terminal windowOpens a man page in a separate Mac Terminal window so your prompt stays free.30 Nov 2026 - Tip
tmux new-window -d -n sync 'rsync -a ~/photos/ /mnt/backup/photos/'tmux new-window -d opens a window without switching to itStarts a command in a new window while you stay where you are.30 Nov 2026 - Tip
ditto ~/Projects/site /Volumes/Backup/siteditto copies folders on a Mac and keeps their metadataCopies files and folders on macOS and keeps resource forks, extended attributes and permissions.24 Nov 2026 - Tip
watch -n 2 'df -h /mnt/user'watch -n 2 runs a command every two seconds and shows the latest outputRepeats any command at a set interval, so you can watch a number change without retyping it.1 Nov 2026 - Tip
watch -d -n 5 'df -h /mnt/backup'watch -d highlights what changed between refreshesReruns a command every few seconds and highlights the parts that changed.1 Oct 2026 - Tip
tmux new -d -s backup 'rsync -a /source/ /target/'tmux new -d -s job 'command' runs a command in the background that survives logoutStarts a command in a detached tmux session, so it keeps running after you log out.10 Sep 2026 - Tip
df -h | tr -s ' ' | cut -d' ' -f1,5Tr -s ' ' makes cut work on aligned terminal columnsSqueezes repeated spaces so cut can pick columns from padded output.22 Apr 2026 - Tip
./backup.sh 2>&1 | tee -a backup.logTee -a writes terminal output to a log and still shows itShows output on screen and appends the same output to a log file.18 Apr 2026
Mac9
- Tip
brew autoremove -nbrew autoremove -n shows which leftover Homebrew dependencies can goLists and removes packages that only came along as a dependency and are unused now.30 Nov 2026 - Tip
brew services start redisbrew services runs a Homebrew database or server in the background on your MacStarts, stops and lists background services installed with Homebrew.30 Nov 2026 - Tip
brew bundle dump --file=~/dotfiles/Brewfilebrew bundle dump writes your whole Homebrew setup to one Brewfile from the terminalSaves every formula, cask and tap you have, ready to install on another Mac.30 Nov 2026 - Tip
brew pin nodebrew pin keeps one Homebrew package at its version in the terminalStops brew upgrade from touching one formula you depend on.30 Nov 2026 - Tip
brew analytics offbrew analytics off stops Homebrew from sending usage dataTurns off Homebrew's anonymous usage analytics and shows whether they are on.28 Nov 2026 - Tip
launchctl kickstart -kp gui/$(id -u)/com.example.agentlaunchctl kickstart -k restarts a background agent on your MacRestarts a stuck background job through launchd instead of killing it blindly.28 Nov 2026 - Tip
brew doctorbrew doctor checks your Homebrew setup for problemsScans your Mac for common Homebrew problems and suggests fixes.28 Nov 2026 - Tip
brew outdated --cask --greedybrew upgrade --greedy also updates casks that update themselvesIncludes self-updating and latest-version apps when Homebrew upgrades your casks.28 Nov 2026 - Tip
caffeinate -i rsync -a ~/Photos /Volumes/backup/caffeinate stops your Mac from sleeping while a long command runsKeeps your Mac awake only while one long command runs, then lets it sleep again.17 Nov 2026
Network4
- Tip
less /var/log/nginx/error.log& in less hides every line that does not match in the terminal pagerFilters a log inside less without quitting and running grep.30 Nov 2026 - Tip
scutil --dnsscutil --dns lists every DNS resolver macOS usesPrints all DNS resolvers macOS uses, with their domains, interfaces and order.28 Nov 2026 - Tip
dns-sd -B _ssh._tcpdns-sd -B lists the Bonjour services on your networkShows which devices on your local network advertise SSH, file sharing or web pages.28 Nov 2026 - Tip
tail -F /var/log/nginx/access.logtail -F keeps following a log after logrotate renames itFollows a log file by name so it keeps working after the file is rotated.8 Oct 2026
Docker3
- Tip
docker compose logs --tail 50 web # now at the top of a clean screenCtrl-l clears the shell screen and keeps the line you are typingClear the terminal without losing the half-typed command.30 Nov 2026 - Tip
cat -A docker-compose.ymlcat -A shows the tabs, line endings and odd characters you cannot seePrints a file with tabs, line ends and control characters made visible.28 Nov 2026 - Tip
tmux send-keys -t work:1.0 'docker compose logs -f' Entertmux send-keys types into a pane you are not looking atSends a command to a chosen tmux pane from the shell, as if you had typed it there.3 Sep 2026
Media3
- Tip
screencapture -V 20 -k ~/Desktop/demo.movscreencapture -V records a screen video for a set time from the Mac terminalRecords the screen for a fixed number of seconds without opening any app.30 Nov 2026 - Tip
taskset -c 0,1 ffmpeg -i in.mkv out.mp4taskset shows and sets which CPU cores a process may useStarts a command on chosen CPU cores or changes the cores of a running process.28 Nov 2026 - Tip
log stream --predicate 'process == "Finder"' --style compactlog stream --predicate watches the Mac log live for one appStreams the macOS unified log live, filtered to one process or subsystem.28 Nov 2026
Web2
- Tip
osascript -l JavaScript -e 'Application("Mail").inbox.messages.whose({subject: {_contains: "invoice"}}).subject()'osascript -l JavaScript scripts Mac apps in JavaScript instead of AppleScriptRuns JavaScript instead of AppleScript to control Mac apps from Terminal.28 Nov 2026 - Tip
textutil -convert html report.rtftextutil -convert turns Word and RTF files into text or HTML on a MacConverts documents between txt, html, rtf, docx and other formats from the Terminal, without opening an app.25 Nov 2026
Security1
Nothing matches.