From 0b0ea33b65565bd2620c00476c211ad80c7d3968 Mon Sep 17 00:00:00 2001 From: Cloud User Date: Thu, 27 Dec 2018 12:11:07 -0500 Subject: [PATCH 1/2] /usr/bin/last --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index e0b609d..a875664 100644 --- a/README.md +++ b/README.md @@ -743,6 +743,7 @@ Linux Security Expert - trainings, howtos, checklists, security tools an * [tr](#tool-tr) * [chmod](#tool-chmod) * [who](#tool-who) + * [last](#tool-last) * [screen](#tool-screen) * [du](#tool-du) * [inotifywait](#tool-inotifywait) @@ -1245,6 +1246,16 @@ who -b ___ +##### Tool: [last] + +###### Was the last reboot a panic? + +```bash +(last -x -f $(ls -1t /var/log/wtmp* | head -2 | tail -1);last -x -f /var/log/wtmp) | grep -A1 reboot | head -2 | grep -q shutdown && echo "clean reboot" || echo "panic reboot" +``` + +___ + ##### Tool: [screen](https://en.wikipedia.org/wiki/GNU_Screen) ###### Start screen in detached mode From 39192cfb1b479e9f9811e2d32b4470930e98ab7e Mon Sep 17 00:00:00 2001 From: lbonanomi Date: Thu, 27 Dec 2018 12:12:37 -0500 Subject: [PATCH 2/2] /usr/bin/last --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a875664..a346c13 100644 --- a/README.md +++ b/README.md @@ -1251,7 +1251,7 @@ ___ ###### Was the last reboot a panic? ```bash -(last -x -f $(ls -1t /var/log/wtmp* | head -2 | tail -1);last -x -f /var/log/wtmp) | grep -A1 reboot | head -2 | grep -q shutdown && echo "clean reboot" || echo "panic reboot" +(last -x -f $(ls -1t /var/log/wtmp* | head -2 | tail -1); last -x -f /var/log/wtmp) | grep -A1 reboot | head -2 | grep -q shutdown && echo "Expected reboot" || echo "Panic reboot" ``` ___