Essential Linux Commands Every DevOps Engineer Should Know (Part 1, 2025 Edition)

Updated: September 14, 2025

Essential Linux Commands Every DevOps Engineer Should Know (Part 1, 2025 Edition)

Linux remains the backbone of modern DevOps, cloud computing, and infrastructure engineering. Whether you're deploying containerized applications on Kubernetes, managing AWS EC2 instances, or building CI/CD pipelines with GitHub Actions or Jenkins, the Linux command line is your most powerful tool.

As a DevOps engineer or site reliability engineer (SRE), mastering these bash commands boosts productivity, enables faster troubleshooting, and improves team collaboration. This comprehensive Linux terminal tutorial covers the essential Linux commands for 2025, including modern replacements for legacy utilities that every system administrator should know.


Understanding Linux Symbols

$( ) – Command Substitution

Used to capture the output of one command and pass it to another:

echo "Today is $(date)"

$ – Variables & Environment

  • Prompt: $ indicates a non-root shell prompt.
  • Variables: echo $HOME prints the current user’s home directory.
  • Process ID: $! references the PID of the last background process.

System Information Commands

These Linux system commands help you gather critical information about your server environment—essential for debugging, capacity planning, and infrastructure automation.

uname – Kernel Information

uname -a

Displays the Linux kernel version, system architecture, and hostname—useful for verifying OS compatibility.

lsb_release – Distro Info

For Debian/Ubuntu-based systems (note: lsb_release is not installed by default on minimal images — install via sudo apt install lsb-release or read /etc/os-release instead):

lsb_release -a
cat /etc/os-release   # works on virtually every modern distro

hostnamectl – Host Information (modern replacement for hostname)

hostnamectl

top / htop – Process Monitoring

  • top: Built-in, basic monitoring.
  • htop: Interactive, colorized, easier navigation (install separately).

File & Directory Management

Mastering Linux file management commands is fundamental for any DevOps workflow, from deploying applications to managing configuration files across production servers.

ls – List Files

ls -lh
  • -l = long format (permissions, ownership, timestamps)
  • -h = human-readable file sizes

cd – Change Directory

cd /var/log
cd ..      # up one level
cd ~       # home directory

mkdir & rmdir – Create/Remove Directories

mkdir -p newdir/subdir
rmdir emptydir

touch – Create/Update File

touch newfile.txt

rm – Remove Files

rm file.txt
rm -rf directory/

⚠️ Always use caution with rm -rf.

cp & mv – Copy and Move Files

cp file.txt /backup/
mv oldname.txt newname.txt

System Maintenance

reboot & shutdown

sudo reboot
sudo shutdown -h now

df – Disk Space

df -h

du – Disk Usage

du -sh /var/log/*

ps & kill

ps aux | grep nginx
sudo kill -9 <PID>

For systemd-managed services, prefer systemctl (e.g., sudo systemctl restart nginx) — it handles graceful shutdown, dependencies, and logging via journalctl. Reach for kill only when a process is unresponsive or not managed by systemd.


User & Group Management

User Commands

sudo useradd -m -s /bin/bash username
sudo passwd username
sudo userdel username

Group Commands

sudo groupadd devops
sudo usermod -aG devops username

Package Management

  • Debian/Ubuntu:
    sudo apt update && sudo apt upgrade
    sudo apt install nginx
    
  • RHEL/CentOS/Fedora:
    sudo dnf install nginx
    
  • Arch Linux:
    sudo pacman -Syu
    

Text Editors

  • nano – Simple editor (nano file.txt)
  • vim – Powerful modal editor (vim file.txt)
  • emacs – Customizable editor (emacs file.txt)

For DevOps workflows, vim remains the most common due to server availability.


Networking Commands

Linux networking commands are critical for troubleshooting connectivity issues, configuring network interfaces, and securing cloud infrastructure. These tools help DevOps engineers diagnose problems in production environments.

ip – Modern Replacement for ifconfig

ip addr show    # Display IP addresses
ip route show   # View routing table

The ip command is the standard network configuration tool in modern Linux distributions.

ss – Modern Replacement for netstat

ss -tuln    # Show listening TCP/UDP ports

Use ss for faster network socket inspection—essential for debugging service connectivity.

Connectivity & DNS Tools

ping google.com                  # Test network connectivity
traceroute github.com            # Trace packet routes (or `mtr` for live continuous tracing)
dig openai.com                   # DNS lookup (install `dnsutils`/`bind-utils` if missing)
curl -I https://api.example.com  # HTTP header check

Firewall Management

sudo ufw status                  # Ubuntu firewall (frontend)
sudo firewall-cmd --list-all     # RHEL/CentOS firewall (frontend)
sudo nft list ruleset            # nftables — the modern Linux packet filter
sudo iptables -L                 # legacy iptables (still works via nft compatibility layer)

Most modern distributions (RHEL 8+, Debian 11+, Ubuntu 22.04+) use nftables under the hood; iptables commands are still accepted but route through an iptables-nft compatibility layer. For new firewall rules on current systems, prefer nft directly or a frontend like ufw/firewalld.


Conclusion

Mastering Linux commands is non-negotiable for DevOps engineers, SREs, and cloud architects. From managing virtual machines to debugging Docker containers and automating infrastructure with Terraform or Ansible, these command line skills are the foundation of modern cloud operations.

In 2025, successful DevOps professionals should:

  • Use modern tools: ip and ss instead of deprecated ifconfig and netstat
  • Leverage htop or btop for real-time system monitoring
  • Master package managers across distributions (apt, dnf, pacman, brew)
  • Follow Linux security best practices for production environments
  • Automate repetitive tasks with bash scripting

Whether you're preparing for a Linux certification (RHCSA, LFCS) or building production infrastructure, these essential commands form the backbone of every DevOps workflow. Keep practicing, and you'll handle any server challenge with confidence.


FREE WEEKLY NEWSLETTER

Stay on the Nerd Track

One email per week — courses, deep dives, tools, and AI experiments.

No spam. Unsubscribe anytime.