mailwal

🐧 25 Essential Linux Commands Every DevOps Engineer Should Know in 2026

Arvind Verma

🐧 25 Essential Linux Commands Every DevOps Engineer Should Know in 2026

Linux isn’t just another skill in DevOps. It’s the foundation behind servers, containers, Kubernetes nodes, CI/CD runners, and production infrastructure.

You can learn Docker, Kubernetes, Terraform, Jenkins, and AWS. But when a production server becomes unresponsive, a deployment fails, disk space reaches 100%, or an application stops listening on its port, Linux knowledge becomes essential.

A DevOps engineer must know how to investigate the operating system, understand processes, troubleshoot networking, manage storage, inspect logs, and automate repetitive tasks.

Here are 25 essential Linux commands worth learning, with practical examples and real-world scenarios.

1. systemctl – Manage Linux Services

What it does: Controls and manages services through systemd.

Why do we need it? Applications such as Nginx, Docker, SSH, and monitoring agents run as Linux services.

Practical commands:

# Check service status
sudo systemctl status nginx

# Start a service
sudo systemctl start nginx

# Stop a service
sudo systemctl stop nginx

# Restart a service
sudo systemctl restart nginx

# Enable service at boot
sudo systemctl enable nginx

Production example: Your Nginx server is not responding. Check its status before restarting it. If it failed, investigate the service logs to identify the actual reason.

2. journalctl – Read System Logs

What it does: Reads logs collected by systemd-journald.

Practical commands:

# View all available journal entries
journalctl

# View logs for Nginx
journalctl -u nginx

# Show recent logs
journalctl -u nginx -n 100

# Follow logs in real time
journalctl -u nginx -f

# View logs from the current boot
journalctl -b

Production example: A service keeps restarting. Use journalctl -u service-name to inspect errors around the time of failure.

3. dmesg – Inspect Kernel Messages

What it does: Displays kernel-related messages, including hardware and device events.

dmesg
dmesg -T
dmesg -T | grep -i error
dmesg -T | grep -i oom

Production example: A Linux server unexpectedly kills an application because of memory pressure. Kernel messages may reveal an Out-of-Memory (OOM) event.

4. ss – Inspect Network Sockets and Ports

What it does: Displays socket statistics and listening network ports.

# Show listening TCP and UDP sockets
ss -tuln

# Show process information
sudo ss -tulnp

# Check a specific port
sudo ss -tulnp | grep :8080

Production example: Your application should listen on port 8080, but the load balancer cannot connect. Check whether the application is actually listening on that port.

5. ip – Configure and Inspect Networking

What it does: Manages network interfaces, IP addresses, and routing.

# Display network interfaces
ip addr

# Show routing table
ip route

# Display link status
ip link

# Show a specific interface
ip addr show eth0

Production example: A server cannot communicate with another subnet. Inspect its IP address and routing table before investigating firewall rules.

6. ping – Test Network Reachability

What it does: Sends ICMP Echo Requests to test whether a destination responds.

ping google.com
ping -c 4 8.8.8.8

Production example: Check basic connectivity to a remote host. If an IP responds but a domain name does not, investigate DNS resolution.

Important: A failed ping does not always mean the server is down. ICMP traffic may be blocked.

7. tcpdump – Capture Network Traffic

What it does: Captures and analyzes network packets.

# Capture traffic on an interface
sudo tcpdump -i eth0

# Capture traffic on port 443
sudo tcpdump -i eth0 port 443

# Capture traffic on port 8080
sudo tcpdump -i eth0 port 8080

# Save packets to a file
sudo tcpdump -i eth0 -w capture.pcap

Production example: An application cannot connect to a backend service. Packet capture can help determine whether requests are leaving the server and whether responses are returning.

8. df – Check Disk Space

What it does: Displays filesystem disk-space usage.

df -h
df -hT

Production example: A Jenkins pipeline fails because the server has no available disk space. Use df -h to identify the affected filesystem.

9. du – Check Directory Space Usage

What it does: Shows how much disk space files and directories consume.

# Check current directory usage
du -sh .

# Check directory sizes
du -sh /var/log/*

# Find the largest directories
du -h --max-depth=1 /var

Production example: Your root filesystem is almost full. Use du to identify large log directories, application files, or cached artifacts.

10. lsblk – List Block Devices

What it does: Displays disks, partitions, and storage devices.

lsblk
lsblk -f

Production example: You attach a new EBS volume to an AWS EC2 instance. Use lsblk to identify the new block device before formatting or mounting it.

11. mount – Attach a Filesystem

What it does: Makes a filesystem accessible at a directory.

# Display mounted filesystems
mount

# Mount a device
sudo mount /dev/xvdf1 /mnt/data

# Unmount a filesystem
sudo umount /mnt/data

Production example: A newly attached disk needs to be mounted before an application can use its storage.

Always verify the device, filesystem, and mount point before making changes.

12. fdisk – Manage Disk Partitions

What it does: Creates and manages disk partitions.

# List partition information
sudo fdisk -l

# Open a disk for partition management
sudo fdisk /dev/xvdf

Production example: A new disk needs partitioning before it can be formatted and mounted.

Caution: Partition changes can destroy data. Verify the target disk and ensure backups exist before modifying production storage.

13. free – Check Memory Usage

What it does: Displays RAM and swap usage.

free -h
free -m

Production example: A server is experiencing slow application performance. Check available memory and swap usage to identify possible memory pressure.

14. vmstat – Analyze System Performance

What it does: Reports memory, CPU, processes, and system activity.

vmstat
vmstat 2 5

The second command displays five reports at two-second intervals.

Production example: An application is slow even though CPU utilization appears normal. Use vmstat to investigate memory pressure, blocked processes, and CPU activity.

15. lsof – List Open Files

What it does: Displays files and sockets currently opened by processes.

# List open files
sudo lsof

# Find process using a port
sudo lsof -i :8080

# Check files opened by a process
sudo lsof -p 1234

Production example: Your application cannot start because port 8080 is already occupied. Use lsof to identify the process using that port.

16. uptime – Check System Uptime and Load

What it does: Displays how long a system has been running and its load averages.

uptime

Production example: A server is responding slowly. Check load averages to understand whether the system is experiencing sustained workload pressure.

Remember: load average is not the same as CPU utilization. Interpret it alongside CPU count and other performance metrics.

17. useradd – Create User Accounts

What it does: Creates a new Linux user.

sudo useradd -m devopsuser

The -m option creates a home directory.

Production example: Create a dedicated account for an engineer who needs controlled access to a Linux server.

18. usermod – Modify User Accounts

What it does: Changes existing user-account properties.

# Add a user to the docker group
sudo usermod -aG docker devopsuser

# Change a user's login shell
sudo usermod -s /bin/bash devopsuser

Production example: An engineer needs Docker access. Add the user to the appropriate group, following your organization’s security policy.

Important: Group membership changes generally require a new login session to take effect.

19. passwd – Manage User Passwords

What it does: Changes user passwords.

# Change your password
passwd

# Change another user's password
sudo passwd devopsuser

# Lock an account
sudo passwd -l devopsuser

Production example: Reset a user’s password or lock an account when access needs to be suspended.

20. chage – Manage Password Expiration

What it does: Configures password aging and expiration policies.

# View password aging information
sudo chage -l devopsuser

# Set password expiration
sudo chage -M 90 devopsuser

# Require a password change at next login
sudo chage -d 0 devopsuser

Production example: Enforce password-aging policies where required by your organization’s security standards.

21. crontab – Schedule Recurring Jobs

What it does: Schedules commands to run automatically at specified times.

# Edit current user's cron jobs
crontab -e

# List scheduled jobs
crontab -l

Example cron entry:

0 2 * * * /opt/scripts/backup.sh

This schedules the backup script to run daily at 2 AM.

Production example: Automate database backups, log cleanup, or periodic maintenance tasks.

22. rsync – Synchronize Files and Backups

What it does: Synchronizes files and directories efficiently.

# Synchronize a directory
rsync -av /source/ /backup/

# Synchronize to a remote server
rsync -av /data/ user@server:/backup/

# Preview changes without transferring
rsync -avn /source/ /backup/

Production example: Synchronize application backups from one server to another.

Important: Be careful with trailing slashes and deletion options. Test with -n before destructive synchronization.

23. ssh – Connect to Remote Servers

What it does: Provides secure remote access using the SSH protocol.

ssh [email protected]

# Connect using a private key
ssh -i my-key.pem ec2-user@server-ip

Production example: Connect securely to an AWS EC2 Linux instance to investigate application or infrastructure issues.

24. scp – Copy Files Over SSH

What it does: Transfers files between systems using SSH.

# Upload a file
scp app.log user@server:/tmp/

# Download a file
scp user@server:/var/log/app.log .

Production example: Copy application logs from a remote server to your local machine for analysis.

25. ufw – Manage Firewall Rules

What it does: Provides a simplified interface for managing firewall rules on supported Linux systems.

# Check firewall status
sudo ufw status

# Allow SSH
sudo ufw allow 22/tcp

# Allow HTTP and HTTPS
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

# Enable firewall
sudo ufw enable

Production example: Restrict incoming traffic so only approved ports are accessible.

Important: Allow SSH before enabling UFW on a remote server, or you may lock yourself out. Also check whether another firewall system manages the host.


How DevOps Engineers Use These Commands in Production

Knowing individual commands is useful. Knowing how to combine them during an incident is what matters.

Imagine this scenario:

Your application is down, and users cannot access the service.

A practical investigation could look like this:

# Check application service
sudo systemctl status nginx

# Inspect recent service logs
sudo journalctl -u nginx -n 100

# Check whether the application port is listening
sudo ss -tulnp

# Identify the process using the port
sudo lsof -i :8080

# Check disk space
df -h

# Check memory usage
free -h

# Inspect network connectivity
ping -c 4 8.8.8.8

# Inspect kernel errors
dmesg -T | tail -50

Each command answers a different question.

Instead of randomly restarting services, you collect evidence, narrow down the possible causes, and choose the safest recovery action.

Final Thoughts

Linux is not just a prerequisite for DevOps. It is one of the most important skills you will use throughout your career.

Whether you’re working with AWS EC2, Docker containers, Kubernetes nodes, Jenkins agents, or production servers, Linux fundamentals help you understand what’s happening underneath the tools.

Don’t just memorize these 25 commands.

Run them in a Linux lab. Understand their output. Break things safely. Practise troubleshooting real scenarios.

Learn Linux. Understand the system. Troubleshoot with confidence. Think like a production engineer.


Connect With Me

I share practical insights on Linux, AWS, Kubernetes, Terraform, DevOps automation, and production troubleshooting.

LinkedIn: https://www.linkedin.com/in/arvindverma021/

Medium: https://medium.com/@arvindverma021

Substack:

DevOps Learning Resources: https://topmate.io/arvindverma021/

Hashtags

#Linux #LinuxCommands #DevOps #LinuxAdministration #AWS #Kubernetes #Docker #Terraform #Jenkins #ShellScripting #Bash #CloudComputing #SRE #PlatformEngineering #ProductionTroubleshooting #LinuxForBeginners #SystemAdministration #DevOpsEngineer #Automation #TechCareers

Arvind Verma is free today. But if you enjoyed this post, you can tell Arvind Verma that their writing is valuable by pledging a future subscription. You won't be charged unless they enable payments.

Pledge your support

Ā© 2026 Arvind Verma
548 Market Street PMB 72296, San Francisco, CA 94104