The uptime command is straightforward and simple, but it can still be nice to see how some sysadmins use these common tools. Documenting the system's uptime may be important for service level agreements, performance monitoring, and general troubleshooting.
[ You might also like: Important Linux /proc filesystem files you need to know ]
The uptime command
The uptime command provides several useful results, depending on the information you need.
Breaking down the output here:
- Current time
- Up (the current status of the system)
- Total time the system has been running
- User count (number of current logged in users)
- System load averages over 1, 5, and 15 minutes
Note: The load average is based on both running and uninterruptable processes.
Documenting system uptime
So how can sysadmins use this information?
First, the command itself gives a quick look at a few general performance parameters. For example, you can see whether the system has restarted recently. You can also see how many users are logged in, letting you know whether the system is busy, if it can be rebooted, or even how useful the local services might be. Obviously, the ability to see the system load averages over time provides important system performance information.
Next, you can combine the uptime results with other commands to document the system's configuration and current status. Such a report might be important for service level agreements or general server availability queries by management. I have written a few quick examples of gathering system information below.
You can use general redirectors to document uptime results:
# uptime > system-doc.txt
Take a look at my recent article Five ways to use redirect operators in Bash for a reminder on using redirectors.
If there's already content in the system-doc.txt file, be sure to use the append redirector instead:
# uptime >> system-doc.txt
It is easy to combine the uptime results with the output of other commands to quickly report on the system's current status:
# date > system-doc.txt
# hostname >> system-doc.txt
# uptime >> system-doc.txt
# ip a >> system-doc.txt
There are plenty of ways to automate and streamline such commands.
The uptime options
The uptime command doesn't have many options. In fact, there are only four, and one of those is the help option to view the other three. That option is -h.
First, use the -p option to organize the uptime output into a "pretty" format. Using this option results in just the system's running time being displayed on the screen.
Redirect it into your documentation file like this:
# uptime -p >> system-doc.txt
Next, display the system date and time since the system started by using the -s option.
SCREEN uptime -s
Redirect it into your documentation file like this:
# uptime -s >> system-doc.txt
Finally, the -V option displays the version information for the uptime command.
# uptime -V
[ Getting started with containers? Check out this free course. Deploying containerized applications: A technical overview. ]
Wrap up
I think it's worth pointing out that the uptime results are also displayed in the first line of the top command's output. That's pretty handy information when troubleshooting performance issues using top. In that case, knowing the system load averages over the five and fifteen-minute ranges is good as related to the current information dynamically displayed in top. For a reminder on how to use and customize top, see this article here on Enable Sysadmin.
While the uptime command is simple, I think it's useful for displaying basic system information. It can answer questions regarding how long the system has been available and give a general idea of performance based on user load.
Sobre o autor
Damon Garn owns Cogspinner Coaction, LLC, a technical writing, editing, and IT project company based in Colorado Springs, CO. Damon authored many CompTIA Official Instructor and Student Guides (Linux+, Cloud+, Cloud Essentials+, Server+) and developed a broad library of interactive, scored labs. He regularly contributes to Enable Sysadmin, SearchNetworking, and CompTIA article repositories. Damon has 20 years of experience as a technical trainer covering Linux, Windows Server, and security content. He is a former sysadmin for US Figure Skating. He lives in Colorado Springs with his family and is a writer, musician, and amateur genealogist.
Mais como este
More than meets the eye: Behind the scenes of Red Hat Enterprise Linux 10 (Part 4)
Looking ahead to 2026: Red Hat’s view across the hybrid cloud
The Overlooked Operating System | Compiler: Stack/Unstuck
Linux, Shadowman, And Open Source Spirit | Compiler
Navegue por canal
Automação
Últimas novidades em automação de TI para empresas de tecnologia, equipes e ambientes
Inteligência artificial
Descubra as atualizações nas plataformas que proporcionam aos clientes executar suas cargas de trabalho de IA em qualquer ambiente
Nuvem híbrida aberta
Veja como construímos um futuro mais flexível com a nuvem híbrida
Segurança
Veja as últimas novidades sobre como reduzimos riscos em ambientes e tecnologias
Edge computing
Saiba quais são as atualizações nas plataformas que simplificam as operações na borda
Infraestrutura
Saiba o que há de mais recente na plataforma Linux empresarial líder mundial
Aplicações
Conheça nossas soluções desenvolvidas para ajudar você a superar os desafios mais complexos de aplicações
Virtualização
O futuro da virtualização empresarial para suas cargas de trabalho on-premise ou na nuvem