Last active
October 10, 2020 02:26
-
-
Save techie2000/ba0596a5ba9f19008825e92f9de3c4d6 to your computer and use it in GitHub Desktop.
When was my 'nix box last rebooted?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '/btime/ {print $2}' /proc/stat | xargs -IUNIX_TIMESTAMP date --date @UNIX_TIMESTAMP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could use
awk '/btime/ {command="date --date @" $2;system(command)}' /proc/stat