if you want to check the uptime of your Linux server then there are a few commands which you can use effectively for collecting this information on system uptime.
The first command which I prefer to use is uptime. Let’s look at the output given below.
[root@localhost /]# uptime 18:02:30 up 2 days, 9:18, 1 user, load average: 0.00, 0.01, 0.05 [root@localhost /]# [root@localhost /]# [root@localhost /]# [root@localhost /]# uptime -p up 2 days, 9 hours, 19 minutes [root@localhost /]#
The second command is Top command.
[root@localhost ~]# top top - 18:25:22 up 2 days, 9:41, 1 user, load average: 0.00, 0.01, 0.05 Tasks: 142 total, 1 running, 141 sleeping, 0 stopped, 0 zombie %Cpu(s): 0.0 us, 0.4 sy, 0.0 ni, 99.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 7924996 total, 7177244 free, 409080 used, 338672 buff/cache KiB Swap: 8126460 total, 8126460 free, 0 used. 7201536 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 22946 root 20 0 162100 2284 1588 R 2.9 0.0 0:00.20 top 1 root 20 0 193692 6784 4148 S 0.0 0.1 0:17.02 systemd 2 root 20 0 0 0 0 S 0.0 0.0 0:00.04 kthreadd 4 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H 6 root 20 0 0 0 0 S 0.0 0.0 0:00.83 ksoftirqd/0 7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0 8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh 9 root 20 0 0 0 0 S 0.0 0.0 1:19.32 rcu_sched 10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain 11 root rt 0 0 0 0 S 0.0 0.0 0:01.16 watchdog/0 12 root rt 0 0 0 0 S 0.0 0.0 0:01.06 watchdog/1 13 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/1 14 root 20 0 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/1 16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H 17 root rt 0 0 0 0 S 0.0 0.0 0:01.03 watchdog/2 18 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/2 19 root 20 0 0 0 0 S 0.0 0.0 0:01.68 ksoftirqd/2 21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/2:0H 22 root rt 0 0 0 0 S 0.0 0.0 0:01.04 watchdog/3 23 root rt 0 0 0 0 S 0.0 0.0 0:00.11 migration/3 24 root 20 0 0 0 0 S 0.0 0.0 0:00.14 ksoftirqd/3 26 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/3:0H 28 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs 29 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
The third one is W Command.
[root@localhost ~]# w 18:26:30 up 2 days, 9:42, 1 user, load average: 0.00, 0.01, 0.05 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts/1 10.17.7.200 18:23 6.00s 0.02s 0.00s w [root@localhost ~]#