Command Cheatsheet

Quick Start
claude --dangerously-skip-permissionsLaunch CC (skip permissions)
ntm attach momentum-analyzerConnect to session
ntm dashboard momentum-analyzerLive status overview
ntm paletteCommand palette

Default prefix key: Ctrl + b — press prefix first, then the command key

Sessions

tmuxStart a new session
tmux new -s nameNew session with name
tmux lsList all sessions
tmux a -t nameAttach to a session
tmux kill-session -t nameKill a session
prefix dDetach from session
prefix sList & switch sessions
prefix $Rename current session
prefix (Previous session
prefix )Next session

Windows (Tabs)

prefix cCreate new window
prefix ,Rename current window
prefix &Close current window
prefix wList all windows
prefix nNext window
prefix pPrevious window
prefix 0-9Switch to window by number
prefix lLast active window
prefix .Move window
prefix fFind window by name

Panes (Splits)

prefix %Split vertically (left/right)
prefix "Split horizontally (top/bottom)
prefix xClose current pane
prefix oCycle through panes
prefix qShow pane numbers
prefix q 0-9Switch to pane by number
prefix zToggle pane zoom (fullscreen)
prefix !Convert pane to window
prefix {Swap pane left
prefix }Swap pane right
prefix SpaceCycle pane layouts

Pane Navigation & Resizing

prefix Move to pane above
prefix Move to pane below
prefix Move to left pane
prefix Move to right pane
prefix Ctrl+Resize pane up
prefix Ctrl+Resize pane down
prefix Ctrl+Resize pane left
prefix Ctrl+Resize pane right
Tip: Hold prefix and press arrow keys repeatedly for continuous resizing.

Copy Mode (Scrolling & Selection)

prefix [Enter copy mode
qExit copy mode
Scroll up / down
PgUp / PgDnPage up / down
g / GGo to top / bottom
/Search forward
?Search backward
n / NNext / previous match
SpaceStart selection
EnterCopy selection
prefix ]Paste buffer
Note: Copy mode uses vi-style keys by default. Set set -g mode-keys vi in .tmux.conf to ensure vi bindings.

Miscellaneous

prefix :Enter command prompt
prefix ?List all key bindings
prefix tShow a clock
prefix ~Show tmux messages
tmux source ~/.tmux.confReload config
tmux list-keysList all bindings
tmux infoShow tmux info
Config: Customize tmux by editing ~/.tmux.conf. Common tweaks include changing the prefix key and enabling mouse support with set -g mouse on.

Essential commands for navigating and working in the terminal

Navigation

pwdPrint current working directory
cd pathChange directory
cd ..Go up one directory
cd ~Go to home directory
cd -Go to previous directory
lsList files and directories
ls -laList all files with details
ls -lhList with human-readable sizes
treeShow directory tree

Files & Directories

touch fileCreate an empty file
mkdir dirCreate a directory
mkdir -p a/b/cCreate nested directories
cp src destCopy file
cp -r src destCopy directory recursively
mv src destMove or rename file
rm fileRemove a file
rm -r dirRemove directory recursively
ln -s target linkCreate symbolic link
Warning: rm -rf is permanent and cannot be undone. Always double-check paths before deleting.

Viewing & Editing Files

cat filePrint file contents
less fileView file with scrolling
head -n 20 fileShow first 20 lines
tail -n 20 fileShow last 20 lines
tail -f fileFollow file in real time
nano fileEdit file with nano
vim fileEdit file with vim
wc -l fileCount lines in a file
diff file1 file2Compare two files

Searching & Finding

find . -name "*.txt"Find files by name
find . -type dFind directories only
grep "text" fileSearch text in a file
grep -r "text" dirSearch recursively in directory
grep -i "text" fileCase-insensitive search
grep -n "text" fileShow line numbers
which commandShow path of a command
locate fileFast search using index

Permissions & Ownership

chmod 755 fileSet file permissions
chmod +x fileMake file executable
chown user:group fileChange file owner
sudo commandRun as superuser
su userSwitch to another user
Tip: Permission digits: r=4 w=2 x=1. So 755 = owner rwx, group r-x, others r-x.

Processes & System

ps auxList all running processes
topReal-time process monitor
htopInteractive process viewer
kill PIDTerminate a process by PID
kill -9 PIDForce kill a process
df -hShow disk usage
du -sh dirSize of a directory
free -hShow memory usage
uname -aSystem information
uptimeHow long system has been running

Piping & Redirection

cmd > fileRedirect output to file (overwrite)
cmd >> fileAppend output to file
cmd 2> fileRedirect errors to file
cmd &> fileRedirect all output to file
cmd1 | cmd2Pipe output of cmd1 to cmd2
cmd | tee fileOutput to screen and file
cmd | sortSort output
cmd | uniqRemove duplicate lines
cmd | xargs cmd2Pass output as arguments

Networking

ping hostTest network connectivity
curl urlFetch URL content
wget urlDownload a file
ssh user@hostConnect via SSH
scp file user@host:pathCopy file over SSH
ifconfigShow network interfaces
netstat -tulnShow open ports
lsof -i :portFind process using a port

Shortcuts & History

Ctrl+CCancel current command
Ctrl+ZSuspend current process
Ctrl+DExit / logout
Ctrl+LClear screen
Ctrl+RSearch command history
Ctrl+AMove cursor to line start
Ctrl+EMove cursor to line end
TabAutocomplete
!!Repeat last command
historyShow command history

Compression & Archives

tar -czf a.tar.gz dirCreate gzipped archive
tar -xzf a.tar.gzExtract gzipped archive
tar -xf archive.tarExtract tar archive
zip -r a.zip dirCreate zip archive
unzip a.zipExtract zip archive
gzip fileCompress file
gunzip file.gzDecompress file

Environment & Variables

echo $VARPrint a variable
export VAR=valueSet environment variable
envList all environment variables
alias name='cmd'Create a shortcut alias
unalias nameRemove an alias
source ~/.bashrcReload shell config
echo $PATHShow executable paths
Tip: Add aliases and exports to ~/.bashrc or ~/.zshrc to make them permanent.

Misc & Useful

man commandShow manual for a command
command --helpQuick help for a command
clearClear the terminal screen
dateShow current date & time
whoamiShow current username
hostnameShow system hostname
calShow a calendar
sleep 5Wait for 5 seconds
yes | commandAuto-confirm prompts