To see how a Linux system is doing, you can use different commands to find out about its performance, how it uses resources, and other details. Here are some popular Linux commands to look at the system status:
top
: Thetop
command provides a dynamic, real-time view of system processes, resource usage, and system performance. Press 'q' to exit.htop
: Similar totop
, but with an improved user interface and more interactive features. You might need to install it on some systems.uptime
: Displays how long the system has been running, the current time, the number of users, and the system load averages for the past 1, 5, and 15 minutes.free
: Shows information about system memory (RAM) usage, including total, used, free, and swap memory.vmstat
: Provides virtual memory statistics. You can usevmstat 1
to get continuous updates.iostat
: Shows input/output (I/O) statistics for devices and partitions. Useful for monitoring disk performance.df
: Displays information about disk space usage on mounted filesystems.du
: Shows the disk usage of files and directories. Useful for finding space hogs.ifconfig
orip a
: Provides network interface information, including IP addresses, MAC addresses, and interface status.netstat
: Displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.ss
: A more modern replacement fornetstat
for displaying socket statistics.ps
: Lists information about running processes. You can use options likeps aux
for a detailed list.lsof
: Lists open files and the processes that opened them.w
: Shows who is logged in and what they are doing.last
: Displays a list of the last logged in users.dmesg
: Shows the kernel ring buffer, which can be useful for diagnosing hardware issues and system startup messages.journalctl
: Access the systemd journal, which contains logs from various system services. It's often used on systems that use Systemd as the init system.sar
: Collects, reports, or saves system activity information. It's part of the sysstat package and might need to be installed.
These commands give different details about your system's condition and how well it's working. Use them when you need to find problems, check how resources are being used, and learn what's going on with your Linux system.