Linux Commands for Cloud Servers: Practical Reference (2026)

Serdar Tekin
Serdar Tekin
Co-Founder & CTO
Updated Nov 17, 202614 min read
Written for: Developers and administrators managing Linux cloud VMs who need a safe task-based command reference.
Linux CommandsCloud ServersSSHsystemdTroubleshootingSecurity
Last reviewed:
Guide
Linux Commands for Cloud Servers: Practical Reference (2026)
rafftechnologies.com/learn
On this page

Key Takeaways

Inspect the current state before every meaningful server change and verify the result immediately afterward. Use SSH, systemctl, journalctl, filesystem, resource, and network commands as evidence rather than guessing. Keep a working SSH session and recovery path open during firewall or access changes. Verify current Raff VM networking, access, backup, and resize capabilities on the live product and pricing pages before relying on a specific platform feature.

Try these commands on your own Linux server, from $4.99 a month.

  1. 1Pick a Linux imageUbuntu, Debian and more, with your SSH key added.
  2. 2Choose a sizeFrom $4.99 a month. Resize when your app grows.
  3. 3Connect over SSHYour server is up in about 55 seconds.

Ubuntu, Debian and other Linux distributions with full root and SSH access, up and running in about 55 seconds.

Linux commands are shell tools used to inspect, configure, secure, monitor, and troubleshoot a Linux server.

For cloud servers, the useful skill is not memorizing hundreds of commands. It is knowing which command reveals the current state, which command changes it, and which command proves the change worked. Most daily work fits into a small operating loop: inspect → change → verify.

For Linux workloads on Raff Technologies, the operating rule for remote administration is simple: inspect before changing anything, and verify immediately after. That habit matters most around SSH, firewalls, permissions, services, storage, and deployments because a small mistake can remove your recovery path.

This guide is a task-based Linux commands cheat sheet for cloud-server administration. Examples use common Ubuntu/Debian and systemd conventions where stated; package names, service units, and file paths can differ by distribution. For the wider access decision, read Bastion Host vs VPN vs Public SSH.

Start with inspection before changing a Linux server

The fastest safe workflow is to pair every change with an inspection command and a verification command.

TaskInspect firstChange only when neededVerify
Service problemsystemctl status, journalctlrestart, reload, or fix configsystemctl status, curl
Disk pressuredf, du, findremove or move known datadf, application check
Memory pressurefree, ps, toptune workload or resizememory + application latency
Firewall changeufw statusadd the required rulenew SSH session + ufw status
File deploymentpwd, ls, rsync --dry-runsync filesfile check + health check
Port conflictss, lsofstop or reconfigure known servicess, application check

A useful first inspection after connecting is:

Bash
hostnamectl whoami pwd ip addr df -h free -h uptime

These commands answer six different questions: which host is this, which account is active, where am I, what network interfaces exist, how full are the filesystems, and what is the current memory/load context?

Do not treat uptime load average as CPU percentage. Linux load can reflect runnable work and tasks waiting in uninterruptible states, so correlate it with CPU, I/O, process, and application evidence before blaming compute.

Quick Linux command map

TaskCommands
Remote accessssh, ssh-keygen
File transferscp, rsync
Navigationpwd, ls, cd
Read filesless, head, tail
Searchgrep, find, awk, sort, uniq
Permissionschmod, chown, id
Packagesapt, dnf
Services and logssystemctl, journalctl
Processes and memoryps, top, free, uptime
Diskdf, du
Networkip, ss, curl, dig, nc
Kernel messagesdmesg
Archivestar
Editingnano, vim, tee

The command name is only the beginning. The operational habit is to know what evidence you expect before and after running it.

SSH and file transfer commands control remote access

SSH is the normal administrative path for Linux cloud servers.

Bash
ssh user@server_ip

With a specific private key:

Bash
ssh -i ~/.ssh/raff_key user@server_ip

Before accepting a first-connection host key, confirm that you are connecting to the expected server and address. Do not copy private keys into tickets, chat, repositories, or shared documents.

Generate an Ed25519 key with:

Bash
ssh-keygen -t ed25519 -C "admin@cloud-server"

For repeated connections, an SSH config entry reduces copy-and-paste errors:

Text
Host production-vm HostName 203.0.113.42 User deploy IdentityFile ~/.ssh/raff_key

Then connect with:

Bash
ssh production-vm

File transfer commands have different risk profiles

Use scp for simple copies:

Bash
scp ./app.tar.gz user@server_ip:/home/user/

Use rsync when transfers are repeated or you need a preview before changing many files:

Bash
rsync -avz --dry-run ./site/ user@server_ip:/var/www/site/

After reviewing the dry run, remove --dry-run only if the source and destination are correct.

Bash
rsync -avz ./site/ user@server_ip:/var/www/site/

Options that delete destination files deserve a separate review. Never add destructive sync flags simply because they appear in a deployment snippet.

Files, permissions, and text tools handle most daily server work

A small group of filesystem commands covers a large part of Linux administration.

Bash
pwd ls -lah cd /var/log cd -

Run pwd and ls -lah before recursive permission changes, archive operations, or cleanup work. cd - returns to the previous directory and is useful when comparing two locations.

For long files, prefer less over dumping everything into the terminal:

Bash
less /var/log/syslog

For recent log lines:

Bash
tail -n 100 /var/log/nginx/error.log tail -f /var/log/nginx/error.log

Use Ctrl+C to stop a live tail.

Search commands reduce guesswork

Search text with grep:

Bash
grep -in "error" /var/log/nginx/error.log grep -n "listen" /etc/nginx/sites-available/default

Find files by type, age, or size:

Bash
find /etc -type f -name "*.conf" find /var/log -type f -mtime -1 sudo find /var -type f -size +500M 2>/dev/null

Use awk, sort, and uniq to summarize structured text. For example, top source IPs in an Nginx access log:

Bash
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head

Permission changes need path verification

Confirm identity first:

Bash
whoami id

Common permission examples include:

Bash
chmod 600 ~/.ssh/id_ed25519 chmod 755 deploy.sh

Change ownership only after confirming the target path:

Bash
pwd ls -la /var/www/app sudo chown -R deploy:deploy /var/www/app

Recursive chmod and chown commands can affect thousands of files. Treat the path as the critical input, not as an afterthought.

Packages and services are the core operating controls

Ubuntu and Debian normally use APT. RHEL-family distributions such as Rocky Linux and AlmaLinux normally use DNF.

On Ubuntu/Debian:

Bash
sudo apt update apt policy nginx sudo apt install nginx

On Rocky/AlmaLinux/Fedora:

Bash
sudo dnf check-update sudo dnf install nginx

Package names and repositories can differ, so check the distribution before copying an installation command from another server.

systemctl controls systemd services

Common inspection commands are:

Bash
sudo systemctl status nginx --no-pager systemctl is-enabled nginx systemctl --failed

When a service has failed, read the logs before restarting it:

Bash
sudo journalctl -u nginx -n 100 --no-pager

If configuration is valid and a reload is supported, a reload may be less disruptive than a full restart:

Bash
sudo systemctl reload nginx sudo systemctl status nginx --no-pager

For an application service, inspect the unit definition when paths or environment configuration look wrong:

Bash
sudo systemctl cat app.service sudo journalctl -u app.service -n 100 --no-pager

The useful sequence is not “restart until it works.” It is status → logs → configuration → controlled change → status → application check.

Resource and network commands diagnose pressure before guessing

Use resource commands to identify which layer is under pressure before changing VM size or application architecture.

CPU, memory, and processes

Bash
uptime free -h ps aux --sort=-%cpu | head ps aux --sort=-%mem | head top

free -h should be interpreted with available memory and swap behavior, not only the “used” column. Linux can use otherwise idle memory for useful cache.

If CPU, memory, disk, or network behavior is affecting latency or stability, use Cloud Server Performance Bottlenecks before resizing.

Filesystem capacity and growth

Bash
df -h df -ih sudo du -h --max-depth=1 /var 2>/dev/null | sort -h

df -h checks space. df -ih checks inode usage. du helps identify which directories are consuming capacity. Do not delete database, upload, log, or backup data until you know who owns it and what recovery path exists.

Network and application reachability

Bash
ip addr ip route sudo ss -tulpn curl -I http://127.0.0.1 curl -I https://example.com dig +short example.com

ss -tulpn shows listening sockets and processes. curl tests the application path. dig tests DNS resolution. These commands answer different questions; a successful ping does not prove that the application is healthy.

For a specific TCP port:

Bash
nc -zv example.com 443

A network diagnosis should follow the path: DNS → route → listening socket → firewall → application response → dependency response.

Firewall and SSH changes need a rollback path

Remote access changes are different from ordinary configuration edits because a mistake can lock you out of the machine.

On Ubuntu with the OpenSSH UFW profile available, inspect first:

Bash
sudo ufw status numbered sudo ss -tulpn | grep ':22'

Allow SSH before enabling the firewall:

Bash
sudo ufw allow OpenSSH sudo ufw enable sudo ufw status numbered

If SSH uses a custom port, allow that port instead of assuming port 22. Keep the current SSH session open and test a second connection before closing the working session.

For SSH server configuration changes, validate syntax before reloading:

Bash
sudo sshd -t

Then use the correct SSH service unit for the distribution and verify a new login before ending the existing session. Do not disable password or root login until key-based access has already been tested for the account you intend to use.

For a deeper access-model decision, use Bastion Host vs VPN vs Public SSH. For firewall policy, use Firewall Best Practices for Cloud Servers.

Troubleshooting works best as a verification sequence

The same small set of commands can diagnose many incidents when they are run in the right order.

SymptomInspectLikely decisionVerify
Website is downcurl, systemctl status, journalctl, ssfix app, proxy, port, or dependencycurl + service status
Service failed after deploysystemctl status, journalctl, systemctl catfix path, config, dependency, permissionsrestart/reload + health check
Disk is fulldf -h, df -ih, duremove/move known data or expand storagedf + app check
Memory pressurefree, ps, logsfix leak, reduce concurrency, add RAMmemory + latency/restarts
Port already in usess, lsofstop known process or change portss + app check
DNS looks wrongdig, curlcorrect record, TTL, resolver, or app routedig from expected resolver

A website-down sequence

Bash
curl -I http://127.0.0.1 sudo systemctl status nginx --no-pager sudo journalctl -u nginx -n 100 --no-pager sudo ss -tulpn | grep ':80\|:443' df -h free -h

This separates application, service, socket, disk, and memory evidence instead of treating every outage as the same problem.

A full-disk sequence

Bash
df -h df -ih sudo du -h --max-depth=1 /var 2>/dev/null | sort -h sudo journalctl --disk-usage

The next action depends on what is consuming the space. Log retention, container layers, package caches, uploads, and databases need different cleanup and recovery decisions.

Kernel messages provide another evidence layer

Bash
sudo dmesg -T | tail -n 100

Kernel messages can reveal device, filesystem, network, or memory-related events that application logs do not contain. Use them as evidence, not as a substitute for application monitoring.

Raff provides the VM layer while Linux operations stay with you

Raff provides the infrastructure layer; the guest operating system remains under your administrative control.

Raff Linux VMs provide server-level administration for the guest operating system, with platform features available for access, networking, storage, protection, automation, and lifecycle management. Check the current Linux VM, cloud VM, and pricing pages for the exact capabilities of the plan you intend to use rather than relying on a hard-coded feature bundle in this command reference.

That division of responsibility matters when using the commands in this guide:

Raff layerLinux administrator layer
Create and resize VMPackages, users, services, application config
Public/private networkingGuest firewall and listening services
Browser consoleSSH identities and server access policy
Snapshots and backupsApplication-aware backup and restore procedures
VM monitoringProcess, service, and application telemetry

The browser console is especially important as a recovery path when an SSH or guest-firewall change blocks remote access.

Use the live Raff pricing page for current VM sizes and subscription terms rather than relying on an old price embedded in a Linux command reference. Use VM Sizing when CPU, RAM, or storage requirements need a separate capacity decision.

Build a small command runbook around your workload

A useful Linux command reference follows the operating sequence of the server rather than the alphabet.

Start with the commands that let you identify the host, user, filesystem, memory, services, sockets, and logs. Add one safe change at a time. Verify the resulting state before moving to the next action. For recurring incidents, save the inspection and verification sequence as a runbook so the next response starts with evidence instead of memory.

For administrative exposure and private access, continue with Bastion Host vs VPN vs Public SSH. For workload pressure, continue with Cloud Server Performance Bottlenecks.

Deploy a Linux VM with full root access, browser console, unmetered bandwidth, private networking, and a recovery path for remote administration.

Was this article helpful?
Serdar Tekin
Serdar Tekin
Co-Founder & CTO

Co-Founder & CTO at Raff, focused on cloud infrastructure, systems architecture, security, reliability, and production operations.

Try these commands on your own Linux server, from $4.99 a month.

Ubuntu, Debian and other Linux distributions with full root and SSH access, up and running in about 55 seconds.

14-day money-back guarantee

Frequently asked questions

What are Linux server commands?
Linux server commands are shell tools used to inspect, configure, secure, monitor, and troubleshoot a Linux host from a terminal or remote SSH session.
Which Linux commands should I learn first for a cloud server?
Start with ssh, pwd, ls, less, grep, systemctl, journalctl, free, df, ss, curl, and your distribution’s package manager. These cover most inspection and troubleshooting tasks.
How should I check a Linux server before changing it?
Confirm the host and user, then inspect disk, memory, load, services, sockets, logs, and the target file or path. Record enough baseline evidence to verify the change afterward.
How do I check whether a Linux service is running?
Use systemctl status service-name on systemd systems, then read recent logs with journalctl -u service-name. Verify the application separately with a health check or curl.
What is the safest way to change a firewall on a remote server?
Inspect existing rules, allow the active SSH path first, keep the current session open, apply the change, and confirm a second SSH connection before closing the working session.
Do these Linux commands work on every distribution?
Many core commands are portable, but package managers, service names, firewall tools, and file paths can differ. Ubuntu/Debian commonly use apt; Rocky/AlmaLinux/Fedora commonly use dnf.
How does Raff support Linux server administration?
Raff Technologies provides Linux VM infrastructure while the guest operating system remains under your administration. Check the current Linux VM and pricing pages for the exact access, networking, backup, automation, and resize capabilities available to the plan you intend to use.