Operations 6 min read

Master Linux System Monitoring: date, uptime, w, top, who, and last Commands

This guide explains how to use essential Linux monitoring commands—including date, uptime, w, top, who, and last—detailing their output formats, key fields, and practical examples for tracking system time, load, user activity, and recent logins.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master Linux System Monitoring: date, uptime, w, top, who, and last Commands

date

The date command is the classic way to display the current system time and is frequently used in scripts to define timestamps.

uptime

[root@localhost ~]# uptime
16:51:24 up 13:02,  1 user,  load average: 0.00, 0.01, 0.05

The first value shows the current time, the second indicates how long the system has been running, the third shows the number of logged‑in users, and the three numbers at the end are the average load over the past 1, 5, and 15 minutes.

w

[modps@gd-mopps02 ~]$ w 17:19:01 up 1983 days, 13:05, 2 users, load average: 26.45, 27.76, 27.72 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT gdmm81 pts/0 10.153.97.38 14:09 23.00s 0.36s 0.01s sshd: gdmm81 [priv] dwtangmi pts/3 10.153.97.56 17:18 0.00s 0.07s 0.01s sshd: dwtangmingqi [priv]

The w command shows who is currently logged in, what they are doing, and how their activity affects system load. It combines the information of uptime, who, and ps -a. Key columns are:

User : login name

TTY : terminal identifier assigned after login

From : remote host name or IP

login@ : login time

IDLE : idle time (reset on any user activity)

JCPU : total CPU time for all processes attached to the terminal, including background jobs

PCPU : CPU time for the current process

WHAT : command line of the running process

top

The top command provides a real‑time view of running processes, refreshing every three seconds by default. It also supports various options to customize the display.

who

[modps@gd-mopps02 ~]$ who
gdmm81   pts/0        2019-01-18 14:09 (10.153.97.38)
dwtangmingqi pts/3   2019-01-18 17:18 (10.153.97.56)

The who command is similar to w but provides slightly less detail, listing each logged‑in user along with their terminal, login time, and originating host.

last

[root@localhost ~]# last root -F | head -1 | awk '{print $4,$5,$6,$7,$8}'
Fri Jan 18 14:55:52 2019

The last command lists recent login sessions. The example extracts the most recent login time for the user root. The -F flag adds full login and logout timestamps, which can be explored further.

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.

LinuxtopuptimewLASTsystem-monitoringwho
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.