← Back to Blog
Linux Commands Every VPS Owner Should Know (2026)
When I first got SSH access to a Linux server I went looking for a comprehensive list of commands to memorize and found about 200 of them. I memorized maybe 15 and they have covered 95% of what I have ever needed to do. Here are the ones that actually matter for day-to-day VPS management.
⚡ VPS from $5/mo — Use code LAUNCH2026 for 50% offNavigation and Files
pwd # Where am I right now?
ls -la # List files including hidden ones with permissions
cd /path/to/dir # Change directory
cd ~ # Go home
cd - # Go back to last directory
cp file.txt backup.txt # Copy a file
mv file.txt /new/path/ # Move or rename a file
rm file.txt # Delete a file (no trash, gone forever)
rm -rf /path/to/dir # Delete a directory and everything in it (careful)
mkdir -p /path/to/dir # Create directory and parents if they don't exist
Viewing and Editing Files
cat file.txt # Print file contents
less file.txt # Scroll through a file (q to quit)
tail -f /var/log/nginx/access.log # Watch a log file in real time
nano file.txt # Edit a file (simpler than vim)
grep "error" file.txt # Search for a word in a file
grep -r "error" /var/log/ # Search recursively in a directory
System Status
top # Live CPU and memory usage (q to quit)
htop # Better version of top (install first)
df -h # Disk usage in human-readable format
free -h # RAM usage
uptime # How long the server has been running
uname -r # Kernel version
Processes
ps aux # List all running processes
ps aux | grep nginx # Find a specific process
kill 1234 # Kill process by PID
kill -9 1234 # Force kill (when regular kill does not work)
pkill nginx # Kill by process name
Services (systemd)
systemctl status nginx # Check if a service is running
systemctl start nginx # Start a service
systemctl stop nginx # Stop a service
systemctl restart nginx # Restart a service
systemctl reload nginx # Reload config without full restart
systemctl enable nginx # Start service automatically on boot
systemctl disable nginx # Remove from autostart
journalctl -u nginx -n 50 # Last 50 log lines for a service
journalctl -u nginx -f # Follow logs in real time
Networking
curl ifconfig.me # Your public IP address
ss -tlnp # Open ports and what is listening on them
ufw status # Firewall rules
ufw allow 80/tcp # Open a port
ufw deny 3306 # Block a port
ping google.com # Test connectivity
wget https://example.com/file # Download a file
File Permissions
chmod 755 file.sh # Make a file executable
chmod -R 644 /var/www/html/ # Set permissions recursively
chown www-data:www-data file # Change file owner
chown -R ubuntu:ubuntu /home/ubuntu/ # Change ownership recursively
Packages (Ubuntu/Debian)
apt update # Update package list
apt upgrade -y # Upgrade all packages
apt install -y nginx # Install a package
apt remove nginx # Remove a package
apt autoremove # Remove unused packages
which nginx # Find where a program is installed
The Ones That Save You When Things Go Wrong
# Server running slow?
top # Find what is using CPU
free -h # Check if you are out of RAM
df -h # Check if disk is full
# Service not starting?
journalctl -u servicename -n 50 # Check the logs
# Port already in use?
ss -tlnp | grep 80 # Find what is using port 80
# Disk full?
du -sh /var/log/* # Find what is taking space
du -sh /* 2>/dev/null | sort -rh | head -10 # Find largest directories
That is genuinely most of what you need. The rest you will look up as you need it, and over time it sticks. The terminal is not as intimidating as it looks from the outside.
Put those commands to use on a $5 VPS
Full root SSH access, Ubuntu 24.04, and a one-click app installer so you spend more time building and less time configuring. Use code LAUNCH2026 for 50% off your first month.
Get Started