Reference

Cheat Sheet

The commands you keep forgetting, with a one-line description and a real example you can copy - 384 across 26 tools. Pick a tool in the sidebar, or search across all of them.

SSH & scp

Connect to remote machines, copy files, and manage keys.
CommandWhat it doesExample
sshConnect to a remote host.ssh [email protected]
ssh -pConnect on a non-default port.ssh -p 2222 [email protected]
ssh -iUse a specific private key.ssh -i ~/.ssh/id_ed25519 [email protected]
ssh-keygenGenerate a new key pair.ssh-keygen -t ed25519 -C "[email protected]"
ssh-copy-idInstall your public key on a server.ssh-copy-id [email protected]
ssh (run a command)Run one command remotely and exit.ssh [email protected] "df -h"
scp (upload)Copy a local file to a remote host.scp app.tar.gz [email protected]:/home/ana/
scp (download)Copy a remote file to your machine.scp [email protected]:/var/log/app.log .
scp -rCopy a whole folder.scp -r ./site [email protected]:/var/www/
ssh -LTunnel a remote port to your machine.ssh -L 8080:localhost:80 [email protected]
ssh (config alias)Connect using a ~/.ssh/config Host alias.ssh prod
ssh-addAdd a key to the running ssh-agent.ssh-add ~/.ssh/id_ed25519
ssh-keygen -RRemove a stale host key after a rebuild.ssh-keygen -R server.com