TutorialsAugust 4, 20266 min read

Essential Linux Commands Every VPS Owner Should Know

New to the command line? This is the practical toolkit — navigation, files, permissions, processes, services, networking and disk — that runs a VPS day to day.

NBy Nxeon

Running a VPS means living in the terminal. You don't need to memorise hundreds of commands — a focused core toolkit handles the vast majority of day-to-day server work. This guide is that toolkit, grouped by task, with the flags you'll actually use. Bookmark it as a cheat sheet.

Getting around the filesystem

pwd                 # where am I?
ls -lah             # list all files, human-readable sizes
cd /var/www         # change directory
find / -name "nginx.conf" 2>/dev/null   # find a file

Working with files

cat file.txt        # print a file
less file.log       # scroll a file (q to quit)
tail -f /var/log/nginx/access.log   # follow a log live
grep "error" app.log            # search within a file
grep -ri "timeout" /etc/nginx/   # recursive, case-insensitive
cp, mv, rm, mkdir   # copy, move, delete, make directory

grep is worth learning well — combined with pipes it answers most "where is X?" questions.

Permissions and ownership

Linux permissions decide who can read, write, and execute. Getting them right is core to security:

chmod 600 secret.env       # owner read/write only
chmod 755 script.sh        # owner all, others read/execute
chown deploy:deploy file   # change owner and group

Managing processes

htop                # interactive process viewer
ps aux | grep node  # find a specific process
kill 1234           # stop a process by PID
kill -9 1234        # force-kill (last resort)

See monitor a Linux VPS for going deeper on process and resource inspection.

{{SCREENSHOT}}

Controlling services with systemctl

Almost everything on a modern server is a systemd service:

sudo systemctl status nginx     # is it running?
sudo systemctl restart nginx    # restart
sudo systemctl enable nginx     # start on boot
sudo systemctl stop nginx       # stop
journalctl -u nginx -f          # follow its logs

The journalctl guide covers reading logs in depth.

Networking basics

ip a                # network interfaces and IPs
sudo ss -tulnp      # what's listening on which ports
ping example.com    # basic reachability
curl -I https://example.com     # fetch HTTP headers

Disk and storage

df -h               # filesystem usage
du -sh /var/*       # size of each item under /var

A full disk causes strange failures — see check and free up disk space.

Package management (Ubuntu/Debian)

sudo apt update              # refresh package lists
sudo apt upgrade             # install available updates
sudo apt install htop        # install a package
sudo apt remove htop         # remove a package

Automate the security ones with automatic security updates.

Running things safely as admin

sudo command        # run one command as root
sudo -i             # interactive root shell

Work as a non-root sudo user and elevate only when needed.

Two habits that save you

  1. Use tab completion — start typing and press Tab; it completes filenames and commands, cutting typos.
  2. Search your history — press Ctrl+R and type part of a past command to recall it. You'll rerun the same commands constantly.

Piping and redirection: where the shell gets powerful

The real power of the command line isn't any single command — it's combining them. Two mechanisms do most of the work. A pipe (|) sends the output of one command into another; redirection (>, >>) sends output to a file:

ps aux | grep nginx | grep -v grep     # find nginx processes, excluding the grep itself
cat access.log | grep 404 | wc -l      # count 404s in a log
du -sh /var/* | sort -rh | head        # biggest directories under /var
echo "hello" > file.txt                # write (overwrites)
echo "more"  >> file.txt               # append
command 2>&1 | tee output.log          # capture stdout+stderr to screen and file

Once these click, you stop hunting for a special tool and start *building* the answer from small pieces. "Show me the top 10 IPs hitting my site" becomes a one-liner: awk '{print $1}' access.log | sort | uniq -c | sort -rn | head.

Editing files and staying oriented

You'll need to edit config files constantly. nano is the friendliest editor for beginners — Ctrl+O saves, Ctrl+X exits — and it's installed almost everywhere. vim is more powerful but has a steeper curve; learning the basics (i to insert, Esc then :wq to save and quit) is worth it eventually. A few habits keep you safe and oriented: back up a config before editing it (cp nginx.conf nginx.conf.bak), use tab completion to avoid path typos, and check where you are with pwd before running anything destructive. Above all, be careful with rm -rf and always double-check the path — there's no recycle bin on a server, which is exactly why tested backups matter. Build these habits early and the terminal becomes a place you work confidently rather than nervously.

FAQ

Do I need to memorise all of these?

No. Learn the categories and keep a cheat sheet. ls, cd, grep, systemctl, and journalctl alone cover most daily work; the rest you'll pick up as you need them.

What's the difference between apt and apt-get?

apt is the newer, friendlier front end with nicer output; apt-get is the older, script-stable interface. For interactive use, prefer apt.

How do I stop a runaway process?

Find its PID with htop or ps aux | grep, then kill <PID>. Use kill -9 only if it won't stop gracefully.

What does sudo actually do?

It runs a single command with root privileges, prompting for your password and logging the action. It's the safe alternative to logging in as root.

A one-screen cheat sheet

Keep these grouped in your head and you can run a server confidently:

  • Navigate: pwd, ls -lah, cd, find
  • Read files: cat, less, tail -f, grep -ri
  • Permissions: chmod, chown
  • Processes: htop, ps aux | grep, kill
  • Services: systemctl status/restart/enable, journalctl -u
  • Network: ip a, ss -tulnp, curl -I
  • Disk: df -h, du -sh
  • Packages: apt update/upgrade/install
  • Admin: sudo, sudo -i
  • Combine: pipes (|) and redirection (>, >>)

You don't learn these by memorising them — you learn them by using them. Tab completion and Ctrl+R history search cut the effort dramatically, and every server task you do reinforces a handful of them until they're automatic. The categories matter more than the exact flags; once you know that systemctl controls services and journalctl reads their logs, the specifics come naturally. Keep this list nearby for a week or two and the command line quickly stops being a barrier and starts being the fastest way to get things done.

Master these and the terminal stops being intimidating. Put them to work on a VPS with full root access and Claude Code preinstalled — see Nxeon for developers and the VPS overview.

#linux#commands#cli#beginners#vps#seobatch

Deploy your first server in under a minute

Creating an account is free and takes no card details. You pay when you deploy — choose a billing term and pay from your wallet or by card at checkout.