Linux VPS

Essential Linux commands cheat sheet for VPS owners

A practical cheat sheet of the Linux commands you use most on a VPS: files, permissions, processes, services, disk, network, packages and logs, grouped by task.

BeginnerLinux VPS2 min read

This cheat sheet collects the commands you will reach for most when running a Linux VPS, grouped by task. Each section links to a full guide when you need more than a one-liner. Commands that change the system need sudo.

Before you start

Files and folders

CommandWhat it does
pwdShow the current folder
ls -lahList files with sizes, owners and hidden files
cd /var/wwwChange folder
mkdir -p a/bCreate nested folders
cp -a src dstCopy, keeping permissions
mv old newMove or rename
rm -r folderDelete a folder (no undo)
cat / less filePrint or page through a file
tail -f file.logFollow a log live
grep -rn "text" /etcSearch inside files
find / -name "*.conf"Find files by name

Users and permissions

CommandWhat it does
whoami / idCurrent user and groups
sudo adduser nameAdd a user (Ubuntu/Debian)
sudo usermod -aG sudo nameAdd to sudo group (wheel on AlmaLinux)
chmod 644 fileSet permissions
chown user:group fileChange owner
passwdChange your password

More: Linux file permissions, add a user.

Processes and services

CommandWhat it does
top / htopLive CPU and memory per process
ps aux --sort=-%mem | headTop memory users
kill PID / kill -9 PIDStop a process / force it
systemctl status nginxService status
sudo systemctl restart nginxRestart a service
journalctl -u nginx -fFollow service logs

More: systemctl and journalctl, monitor server resources.

Disk and memory

CommandWhat it does
df -hFree space per filesystem
du -sh *Size of each item here
ncdu /Browse disk usage
free -hRAM and swap usage
lsblk -fDisks, partitions and filesystems

More: df, du and ncdu.

Networking

CommandWhat it does
ip aIP addresses
ss -tulpnListening ports and programs
ping -c 4 hostBasic reachability
curl -I https://example.comFetch HTTP headers
dig example.comDNS lookup

Firewalls and port rules are covered in Linux firewall comparison and check open ports.

Packages and system

CommandWhat it does
sudo apt update && sudo apt upgradeUpdate Ubuntu/Debian
sudo dnf upgradeUpdate AlmaLinux/Rocky
uname -rRunning kernel
cat /etc/os-releaseDistro and version
uptimeUptime and load average
sudo rebootReboot

Archives and transfers

CommandWhat it does
tar -czf site.tar.gz folderCreate a compressed archive
tar -xzf site.tar.gzExtract it
scp file user@host:/pathCopy a file over SSH
rsync -avz src/ user@host:/dst/Sync folders over SSH

Danger: Commands like rm -rf, chmod -R 777 or dd can destroy a server in seconds. Read the command twice before pressing Enter.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.