In this article, we have covered different ways to check system uptime as well service uptime. Please note, the difference in syntax between service and systemctl commands above. But in case of systemctl you need to mention status keyword before service name $ sudo systemctl status apache2 You can also use systemctl command just like service command, to get service status. In the above output, you will see Active flag, which shows how long your service has been running. Process: 860 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCES Loaded: loaded (/lib/systemd/system/rvice enabled vendor preset:ĭrop-In: /lib/systemd/system/Īctive: active (running) since Fri 10:13:09 UTC 18h ago Just mention your service name after service command, followed by status keyword. If you want to check status of particular service like apache2, you can use service command as shown. Tasks: 107 total, 1 running, 68 sleeping, 0 stopped, 0 zombie It updates dynamically and also shows system uptime & load. Top command shows the top processes as per their cpu consumption. You can use any filename instead of filename.txt.
It also shows current time, how long your system has been up, number of current users, system load for past 1, 5, 15 minutes. Type uptime server /a >filename.txt, where filename.txt is the name of a text file that will contain the information. W command also shows information similar to uptime. If you want to see the last reboot time, use -s options $ uptime -s If you only want to see how long your system has been up, run uptime -p command.
It displays current time, number of hours & minutes your system has been up, number of current users, and load average for past 1, 5, 15 minutes. You can even receive notifications directly to your mobile phone when a problem is identified. Monitoring capabilities are advanced, covering domain expiry, SSL/TLS certificates, and website defacement. Uptime command tells you how long the system has been running. This program is suitable for monitoring the uptime and performance of IPv4/IPv6 enabled websites from more than 90 locations across the globe. It will show you stats about your system, since last reboot. You can use uptime, w or top command to check system uptime.
We will look at how to check both service as well as system uptime in Linux. There are various tools to check uptime in Linux. You can use these steps for all Linux distributions. In this article, we will look at how to measure the uptime of system as well as a specific service in Linux. Sometimes you may need to check uptime of service or process in Linux.