In Manjaro/GPD Pocket 3, this works:
Code: Select all
sudo tuptime | awk -F'=' '/System uptime:/ {print substr($2, 1, length($2)-3)}'
Code: Select all
6h 17m
But Arch/Tuptime produces different reading/syntax when using
Code: Select all
sudo tuptime
Code: Select all
jake@p1:~$ sudo tuptime
System startups: 4 since 11:05:59 AM 10/01/2022
System shutdowns: 3 ok <- 0 bad
System uptime: 97.84 % - 52 minutes and 36 seconds
System downtime: 2.16 % - 1 minute and 10 seconds
System life: 53 minutes and 46 seconds
Largest uptime: 27 minutes and 54 seconds from 11:31:51 AM 10/01/2022
Shortest uptime: 3 minutes and 37 seconds from 11:13:33 AM 10/01/2022
Average uptime: 13 minutes and 9 seconds
Largest downtime: 24 seconds from 11:13:09 AM 10/01/2022
Shortest downtime: 23 seconds from 11:31:28 AM 10/01/2022
Average downtime: 23 seconds
Current uptime: 27 minutes and 54 seconds since 11:31:51 AM 10/01/2022
This syntax is far above my paygrade so any help from veterans would be much appreciated.