1

When I use the uptime command on my linux vb, it shows its output like this before it has been on for longer than 1 hour;

13:45:25 up 40 min, 3 users, load average: 0.41, 0.37, 0.27

But after the first hour of on-time, it displays it like this;

13:45:25 up 01:40, 3 users, load average: 0.41, 0.37, 0.27

So it changes the human readable(?) up 40 minutes to the digital of up 01:40. What I want from my new uptime command is that it always gives the uptime in digital clock, so even when the pc has been on for 1 minute, it shows it like this; 13:45:25 up 00:01, 3 users, load average: 0.41, 0.37, 0.27

daan
  • 11
  • 1
  • Welcome to Unix.SE! What’s your question? Are you having trouble writing “your new `uptime` command”? – Stephen Kitt Jun 11 '19 at 12:09
  • 1
    this answer: https://unix.stackexchange.com/questions/275907/on-linux-when-does-uptime-start-counting-from/275921#275921 might be useful – fcbsd Jun 11 '19 at 12:12
  • 3
    `/proc/uptime` has number of seconds the system has been up for. You may do with it whatever pleases you. – deimos Jun 11 '19 at 12:14
  • 1
    after somme days, uptimes will reply `14:13:42 up 128 days, 9:50, 2 users, load average: 0.00, 0.00, 0.00` how should it behave ? (note that after a year you still get uptime in days). – Archemar Jun 11 '19 at 12:15
  • Yes I know, i was just wondering if somewhere in system files or somethign there would be a file with the exact time, so even if it had been on for a year it would still show it like 4523:23 < 4523 hours and 23 minutes – daan Jun 11 '19 at 14:47

0 Answers0