Created
September 8, 2022 18:38
-
-
Save ip413/64004dd49b58d20efdde42412b7680bd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/sh | |
journalctl -r -S "1 day ago" | grep "System returned from sleep state" | head -1 | awk '{print $1, $2, $3}' | {read last_wake_up; echo $(($(date --date="now" +%s) - $(date --date="$last_wake_up" +%s)))} | {read sec ; eval "echo $(date -ud "@$sec" +'$((%s/3600/24)) days %H hours %M minutes %S seconds')"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment