Reference
Linux commands cheat sheet for VPS owners
You don't need hundreds of commands to run a server. These are the ones that come up every week, grouped by what you're trying to do. Commands that change the system need sudo if you're not logged in as root.
Moving around and files
| Command | What it does |
|---|---|
pwd | Show the current directory |
ls -lah | List files with sizes and hidden files |
cd /var/www | Change directory |
mkdir -p app/data | Create directories, including parents |
cp -r src dst | Copy files or folders |
mv old new | Move or rename |
rm -r folder | Delete (no recycle bin — double-check!) |
nano file.conf | Edit a file (Ctrl+O save, Ctrl+X exit) |
cat / less file | Print / scroll through a file |
grep -rn "text" /etc | Find text inside files |
find / -name "*.log" | Find files by name |
Disk and memory
| Command | What it does |
|---|---|
df -h | Free disk space per partition |
du -sh * | sort -h | Which folders are biggest |
free -m | RAM and swap usage |
ncdu / | Interactive disk-usage browser (install first) |
Processes and performance
| Command | What it does |
|---|---|
htop | Live CPU/RAM per process (install with apt) |
ps aux | grep node | Find a running process |
kill 1234 / kill -9 1234 | Stop / force-stop a process by PID |
uptime | How long the server has run, plus load |
nproc | Number of CPU cores |
Services (systemd)
| Command | What it does |
|---|---|
systemctl status nginx | Is a service running? Recent log lines |
systemctl restart nginx | Restart after a config change |
systemctl enable --now app | Start now and on every boot |
journalctl -u nginx -f | Follow a service's log live |
journalctl --disk-usage | How much space the logs take |
Network
| Command | What it does |
|---|---|
ip a | Your IP addresses |
ss -tulpn | Which ports are open and which program listens |
curl -I https://example.com | Test a website from the server |
ping -c 4 1.1.1.1 | Check connectivity |
ufw status / ufw allow 443 | Firewall status / open a port |
Run
ss -tulpn after installing anything. If a database (MySQL 3306, PostgreSQL 5432, Redis 6379, MongoDB 27017) listens on 0.0.0.0, it's open to the whole internet — bind it to 127.0.0.1 or firewall it.Users and permissions
| Command | What it does |
|---|---|
adduser deploy | Create a user |
usermod -aG sudo deploy | Give the user admin rights |
chown -R deploy:deploy /srv/app | Change ownership |
chmod 600 file | Owner-only read/write — work it out with the chmod calculator |
passwd | Change your password |
Updates and packages (Ubuntu/Debian)
| Command | What it does |
|---|---|
apt update && apt upgrade -y | Install all updates |
apt install htop | Install a package |
apt autoremove | Remove leftovers |
reboot | Restart the server |
New to servers? Start with what a VPS is and how to connect over SSH.
Our pick
Deploy a VPS on Kvantis
Hourly billing, paid in crypto, no KYC. Your server is live in about a minute.
- Plans from $10/month + VAT, billed per hour — destroy anytime
- 32 locations worldwide, IPv4 + IPv6, full root
- BTC, ETH, USDT, USDC, LTC and 30+ coins; just an email to sign up
Disclosure: Kvnthost is run by the team behind Kvantis.
More: all guides · VPS ping test · tools