Operations 5 min read

Essential Linux Commands for Diagnosing Production Issues

A practical guide explains how to use top, iostat, netstat, df, du and other common Linux commands to monitor CPU, memory, disk, and network status, interpret their output, and troubleshoot performance problems in production environments.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Essential Linux Commands for Diagnosing Production Issues

This article introduces several frequently used Linux commands for diagnosing online production issues.

top – System Overview

The top command provides a snapshot similar to Windows Task Manager, showing overall system load and per‑process resource usage.

top - 18:14:58 up 112 days, 1:35, 1 user, load average: 0.00, 0.10, 0.11

Key fields:

Current time

Uptime (days, hours, minutes)

Number of logged‑in users

Load averages for the last 1, 5, and 15 minutes (values >1 indicate overload)

Tasks: 225 total, 1 running, 224 sleeping, 0 stopped, 0 zombie

Task line explains total processes, how many are running, sleeping, stopped, or zombie.

CPU Usage

Cpu(s): 1.8%us, 0.9%sy, 0.0%ni, 97.1%id, 0.1%wa, 0.0%hi, 0.1%si, 0.0%st

Fields:

us – user‑space CPU percentage

sy – kernel‑space CPU percentage

ni – processes with altered priority

id – idle CPU

wa – I/O wait

hi – hardware interrupts

si – software interrupts

Memory Usage

Mem: 32879852k total, 23633040k used, 9246812k free, 311552k buffers

Breakdown of physical memory: total, used, free, and kernel buffers. Available memory can be calculated as free + buffers + cached.

Swap Usage

Swap: 4194300k total, 255104k used, 3939196k free, 10422508k cached

Shows virtual memory statistics.

Other Useful Commands

iostat

Displays CPU and I/O statistics.

iostat -d
iostat -d 2 2
iostat -x 1 2

netstat

Shows network connections; pay special attention to the number of ESTABLISHED connections.

netstat -na | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c
netstat -na | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

df -h

Displays disk space usage in a human‑readable format.

du -sh

Shows the size of a directory or file; variations include du --max-depth=2 --block-size=M or ll --block-size=M.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linuxsystem-monitoringtopdisk usagenetstatiostat
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.