pwdFiles and foldersShow the folder you are in
pwdPrint the full path of the current folder, for example /home/deploy
pwd -PPrint the real path, with any symbolic links resolved
Linux command glossary
A plain-English glossary of the Linux commands you use over SSH: files, permissions, processes, networking, SSH and more. Every command has a short explanation and copy-ready examples.
Type these in the terminal of any Linux server you log in to, or in SSH Command's Shell mode.
New: the ssh command explained — syntax, options, keys, tunnels and error fixes →
If you only learn a few, learn these. Click a command name for every example and option in its category.
pwdFiles and foldersShow the folder you are in
pwdPrint the full path of the current folder, for example /home/deploy
pwd -PPrint the real path, with any symbolic links resolved
lsFiles and foldersList files and folders
lsList the names in the current folder
ls -lahLong list with permissions, owner, human-readable sizes and hidden files
cdFiles and foldersChange folder
cd /var/wwwGo to an absolute path
cd ..Go up one level
mkdirFiles and foldersCreate a folder
mkdir backupsCreate one folder
mkdir -p projects/site/cssCreate a whole chain of folders at once; no error if they already exist
cpFiles and foldersCopy files and folders
cp report.txt report-backup.txtCopy a file
cp -r site site-backupCopy a folder and everything inside it (-r means recursive)
mvFiles and foldersMove or rename
mv old.txt new.txtRename a file
mv report.txt /srv/reports/Move a file to another folder
rmFiles and foldersDelete files and folders
rm temp.txtDelete one file
rm -i *.tmpAsk before each delete
catReading and editing textPrint a file
cat notes.txtPrint the whole file
cat -n script.shPrint with line numbers
lessReading and editing textRead a long file page by page
less /var/log/syslogOpen a log; use arrows or Space to move, / to search, q to quit
less +F app.logOpen and follow new lines as they arrive (Ctrl+C to stop following)
tailReading and editing textShow the last lines
sudo tail -n 50 /var/log/nginx/error.logLast 50 lines (most files in /var/log need sudo)
sudo tail -f /var/log/syslogKeep watching new lines as they are added (Ctrl+C to stop)
nanoReading and editing textSimple text editor
nano /etc/hostsOpen a file (use sudo for system files)
grepSearch and filterSearch for text
grep "error" app.logLines that contain error
grep -i "timeout" app.logIgnore capital letters
findSearch and filterFind files by name, size or age
find /var/www -name "*.php"Every .php file below /var/www
find . -type d -name "backup*"Folders whose name starts with backup
chmodPermissions and ownershipChange permissions
chmod 644 index.htmlOwner reads and writes; everyone else reads
chmod 755 deploy.shEveryone can run it; only the owner can change it
chownPermissions and ownershipChange the owner
sudo chown deploy file.txtMake deploy the owner
sudo chown deploy:www-data file.txtChange owner and group together
sudoPermissions and ownershipRun one command as the administrator
sudo apt updateRun a command as root
sudo -iOpen a root shell (type exit to leave)
whoamiPermissions and ownershipShow who you are logged in as
whoamiPrints your user name
psProcesses and servicesList processes
ps auxEvery process, with owner, CPU and memory
ps aux | grep nginxFind one program
topProcesses and servicesLive process monitor
topLive list; press q to quit, M to sort by memory, P by CPU
killProcesses and servicesStop a process by number
kill 1234Politely ask process 1234 to stop
kill -9 1234Force it to stop (last resort)
systemctlProcesses and servicesManage services
systemctl status nginxIs it running? Shows recent log lines too
sudo systemctl restart nginxStop and start
journalctlProcesses and servicesRead service logs
sudo journalctl -u nginxLogs of one service
sudo journalctl -u nginx -fFollow the log live
dfDisk and storageFree disk space
df -hSpace per disk in human-readable sizes
df -hT /One filesystem including its type
duDisk and storageSpace used by folders
sudo du -sh /var/logTotal size of a folder
sudo du -h --max-depth=1 /var 2>/dev/nullSize of each sub-folder (2>/dev/null hides the errors for folders you cannot open)
freeDisk and storageMemory use
free -hRAM and swap in human-readable sizes
unameSystem informationKernel and system
uname -aKernel version, host name and architecture
uname -mJust the architecture (x86_64, aarch64)
historySystem informationCommands you typed before
historyNumbered list
history | grep sshFind an earlier command
ipNetworkingNetwork addresses and routes
ip aShow interfaces and IP addresses
ip rShow the routing table
pingNetworkingTest if a host answers
ping -c 4 example.comSend four packets and stop
ping -c 4 8.8.8.8Test the internet without involving DNS
ssNetworkingShow listening ports and connections
ss -tulpnListening TCP/UDP ports and the program using each (use sudo to see all)
ss -t state establishedActive TCP connections
curlNetworkingTalk to web servers
curl https://example.comPrint the page
curl -I https://example.comOnly the response headers
sshSSH and file transferLog in to a server
ssh deploy@203.0.113.10Log in as deploy
ssh -p 2222 deploy@example.comUse a different port
ssh-keygenSSH and file transferMake a key pair
ssh-keygen -t ed25519 -C "me@example.com"Create a modern key (recommended)
ssh-keygen -lf ~/.ssh/id_ed25519.pubShow a key's fingerprint
scpSSH and file transferCopy files over SSH
scp report.pdf deploy@example.com:/home/deploy/Upload a file
scp deploy@example.com:/var/log/app.log .Download a file to the current folder
rsyncSSH and file transferSmart copying and syncing
rsync -avz site/ deploy@example.com:/var/www/site/Upload only what changed, compressed
rsync -avz --progress deploy@example.com:/backups/ ./backups/Download with progress
tarArchives and compressionPack and unpack archives
tar -czvf backup.tar.gz /var/wwwCreate a compressed archive (c = create, z = gzip, v = show files, f = file name)
tar -xzvf backup.tar.gzExtract it (x = extract)
aptInstalling softwareDebian and Ubuntu
sudo apt updateRefresh the list of available software
sudo apt upgradeInstall available updates
echoShell basics and scriptingPrint text
echo "Hello"Print a line
echo $HOMEPrint a variable
manShell basics and scriptingRead the manual
man tarThe full manual for tar (q to quit)
tar --helpA shorter summary
Move around, create, copy, rename and delete files and folders. These are the commands you will type every single day.
Look inside files, follow growing log files and edit text from the terminal.
Find text inside files, find files by name or size, and shape the output of other commands.
Control who can read, change and run a file, and become the administrator when you need to.
Create and manage accounts, and see who is logged in.
See what is running, stop what is stuck, and manage background services.
Check free space, find what is using it, and work with disks and mounts.
Find out what machine you are on, how busy it is and what has happened.
Check connections, addresses, DNS and ports; download things; manage the firewall.
Log in to servers, copy files between machines and set up passwordless keys.
Pack many files into one, and make big files small.
Install, update and remove programs. The command depends on your Linux family.
Small commands that make the terminal faster, and the first steps of scripts.
SSH Command is a desktop app for Mac, Windows and Linux that puts a real terminal, SFTP file panes, a sudo switch and a searchable Linux command finder in one window. Type what you want to do, and send the command to your server with one click.
Download free Windows commands with examples SFTP & FTP client
An SSH command is any command you type on a Linux server after logging in over SSH (Secure Shell). The word also names the ssh program itself, which opens the encrypted login. Once logged in, every command in this glossary works the same as on a local terminal.
Log in with ssh user@host and type the commands, or run one command without opening a shell: ssh user@host "df -h". A desktop client such as SSH Command gives you a terminal, a file browser and a sudo switch in one window.
Start with pwd, ls, cd, cat, cp, mv, rm, mkdir, grep, chmod, sudo, ps, df and ssh. They are all in the “Most used commands” section on this page.
Yes. rm -rf deletes a folder and everything inside it immediately, without a recycle bin and without asking. Check the path carefully, and try ls on the same path first.
cd is built into the shell, so sudo cannot start it as a separate program. Use sudo -i for a root shell, or sudo ls /folder to look inside a folder.