PalmaSolutions

Uptime Command

Dec 27th, 2018
585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.26 KB | None | 0 0
  1. # Get the uptime in a readable format
  2. # Source https://www.mariusv.com/grep-sed-and-awk
  3.  
  4. uptime | awk 'BEGIN {FS=" "} { gsub(",",""); if (index($0,"day")) {gsub(":"," hours, ",$5);print $3" "$4", "$5" minutes"} else {gsub(":"," hours, ",$3); print $3" minutes"}}
Advertisement
Add Comment
Please, Sign In to add comment