Linux command
uptime 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show system uptime
uptime
Show uptime in pretty format
uptime -p
Show when the system was booted
uptime -s
说明
uptime displays how long the system has been running, the number of users currently logged in, and the system load averages for the past 1, 5, and 15 minutes. Load averages represent the average number of processes waiting for CPU time. On a single-CPU system, a load of 1.0 means the CPU is fully utilized. On a 4-CPU system, a load of 4.0 indicates full utilization. Values above the CPU count suggest processes are waiting for CPU time. The command reads from /proc/uptime for system uptime and /var/run/utmp for user information. It is part of the procps-ng package.
参数
- -p, --pretty
- Show uptime in human-readable format
- -s, --since
- Show date and time when system started (yyyy-mm-dd HH:MM:SS)
- -h, --help
- Display help message
- -V, --version
- Display version information
FAQ
What is the uptime command used for?
uptime displays how long the system has been running, the number of users currently logged in, and the system load averages for the past 1, 5, and 15 minutes. Load averages represent the average number of processes waiting for CPU time. On a single-CPU system, a load of 1.0 means the CPU is fully utilized. On a 4-CPU system, a load of 4.0 indicates full utilization. Values above the CPU count suggest processes are waiting for CPU time. The command reads from /proc/uptime for system uptime and /var/run/utmp for user information. It is part of the procps-ng package.
How do I run a basic uptime example?
Run `uptime` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --pretty do in uptime?
Show uptime in human-readable format