#pwd
Show the folder you are in
pwdpwdPrint the full path of the current folder, for example /home/deploy
pwd -PPrint the real path, with any symbolic links resolved
pwdShow the folder you are in
pwdpwdPrint the full path of the current folder, for example /home/deploy
pwd -PPrint the real path, with any symbolic links resolved
lsList files and folders
ls [options] [path]lsList the names in the current folder
ls -lahLong list with permissions, owner, human-readable sizes and hidden files
ls -ltNewest files first
ls -lS /var/logBiggest files first in /var/log
ls -d */Show only the folders
cdChange folder
cd [folder]cd /var/wwwGo to an absolute path
cd ..Go up one level
cd ~Go to your home folder (typing just cd does the same)
cd -Jump back to the folder you were in before
mkdirCreate a folder
mkdir [options] namemkdir backupsCreate one folder
mkdir -p projects/site/cssCreate a whole chain of folders at once; no error if they already exist
mkdir -m 700 privateCreate a folder only you can open
rmdirRemove an empty folder
rmdir folderrmdir old-logsRemove the folder only if it is empty
rmdir -p a/b/cRemove c, then b, then a (each must be empty)
touchCreate an empty file or update a file's time
touch filetouch notes.txtCreate notes.txt if it does not exist
touch -d "2026-01-31 10:00" report.txtSet the modified time to a chosen date
cpCopy files and folders
cp [options] source destinationcp report.txt report-backup.txtCopy a file
cp -r site site-backupCopy a folder and everything inside it (-r means recursive)
cp -a /etc/nginx /backup/nginxCopy and keep permissions, owners and dates (archive mode)
cp -i *.conf /etc/app/Ask before replacing any existing file
mvMove or rename
mv [options] source destinationmv old.txt new.txtRename a file
mv report.txt /srv/reports/Move a file to another folder
mv -n *.log archive/Move, but never overwrite files that already exist there
rmDelete files and folders
rm [options] filerm temp.txtDelete one file
rm -i *.tmpAsk before each delete
rm -r old-siteDelete a folder and everything inside it
rm -rf buildForce-delete without asking (be careful)
lnCreate links (shortcuts)
ln -s target link-nameln -s /var/www/site currentCreate a symbolic link named current that points to /var/www/site
ln file.txt hardlink.txtCreate a hard link (a second name for the same data)
treeShow folders as a tree
tree [options] [path]tree -L 2Show two levels deep
tree -a -I node_modulesInclude hidden files but skip node_modules
statShow detailed file information
stat filestat index.htmlSize, owner, permissions and all three timestamps
stat -c '%a %U %n' *Print just the permission number, owner and name for each file
fileFind out what kind of file it is
file namefile photo.jpgSays "JPEG image data" even if the name is misleading
file /bin/lsSays it is an executable program
basenameGet the file name from a path
basename path [suffix]basename /var/log/syslogPrints syslog
basename photo.jpg .jpgPrints photo
dirnameGet the folder part of a path
dirname pathdirname /var/log/syslogPrints /var/log
realpathShow the full absolute path
realpath pathrealpath ../logs/app.logResolves .. and links into one full path
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