Skip to main content

D-SERV Refresh promotion: 15% OFF

Claim now →
D-SERV

Linux terminal cheatsheet for VPS owners

The 40 commands you actually use: files, processes, networking, firewall, services, logs and disk usage.

7 min readVPS

Your D-SERV VPS is unmanaged, so the terminal is your control room. These are the commands you’ll reach for every week, grouped by task.

Files & directories

bash
ls -lah                 # list files with sizescd /var/www             # change directorycp -r src/ backup/      # copy recursivelymv old.txt new.txt      # move / renamerm -rf ./tmp            # delete (careful!)nano /etc/hosts         # edit a filetar -czf site.tgz www/  # compress a folder

System & processes

bash
htop                    # live CPU / RAM viewdf -h                   # disk usage by mountdu -sh * | sort -h      # biggest folders herefree -h                 # memory usageps aux | grep java      # find a processkill -9 <PID>           # force-stop a process

Services & logs

bash
systemctl status nginxsystemctl restart nginxsystemctl enable --now dockerjournalctl -u nginx -f          # follow service logstail -f /var/log/syslog

Networking & firewall

bash
ip a                          # IP addressesss -tulpn                     # listening portsufw allow 22/tcp              # allow SSHufw allow 30120               # allow a game portufw enable && ufw statuscurl -I https://d-serv.uk     # test HTTP

Updates & packages

bash
apt update && apt upgrade -y     # Ubuntu / D-SERV OSdnf upgrade -y                   # AlmaLinuxapt install -y screen git unzip

SSH hardening

sshd_config
adduser deploy && usermod -aG sudo deployssh-copy-id deploy@your-vps-ip# then in /etc/ssh/sshd_config:PermitRootLogin noPasswordAuthentication no
Warning:

Test your SSH key login in a second terminal before disabling password authentication, or you can lock yourself out.

Still stuck?

Our engineers configure servers every day — we're here to help.

Ask a human
All guides

Planning a migration or a new project?

Tell us what you run today. We’ll propose a setup and a fixed monthly price — and migrate your servers, sites and mailboxes for free.