#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
Eight commands cover most of what you do on a Linux server every day. In this video, we run each one live on an Ubuntu server, using SSH Command. First, connect. Click Connect, enter your server's address, your username, and your password. Or leave authentication on Automatic, and SSH Command will use your SSH keys. Choose Shell. Now you have a real terminal on the server, and every command here runs on the server, not on your computer. Let's start with pwd, which stands for print working directory. It tells you where you are right now. We're in slash home slash deploy, the home folder of the user, deploy. ls lists what's inside the current folder. Folders show up in blue. Add dash l for the long format. You get permissions, owner, size, and the date each item was changed. Add dash a to include hidden files, the ones that start with a dot. And dash h turns sizes into something humans can read. Put them together, ls dash l a h. This is the version most administrators type from memory. cd changes directory. Type cd projects, and you move into the projects folder. Run ls to see what's inside. cd dot dot goes up one level. And cd on its own always takes you straight back home, wherever you are. mkdir makes a new folder. Add dash p, and it builds a whole path in one go, including any parent folders that don't exist yet. touch creates an empty file. If the file already exists, it only updates its timestamp. cp copies. Give it a file, and a destination. To copy a whole folder, add dash r, which means recursive. mv moves a file. It's also how you rename one. It's the same command, because renaming is just moving to a new name. rm removes files. There is no recycle bin on Linux, so check before you press enter. For a folder, use rm dash r. And rmdir only removes folders that are empty. Switch back to Files, and look at the right-hand pane. It shows the same server, and the same folders you just built. SSH Command keeps your shell and your files on one connection, and you can drag and drop between the two sides. And if you ever forget a command, use the search bar at the top. Type a name, and SSH Command shows the command with its options, ready to copy into the terminal. Those are the eight commands. Every one of them is explained, with examples, at ssh command dot com. Download SSH Command free for personal use. The link is in the description. Thanks for watching.
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