🖥️last

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the last command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ██╗      █████╗ ███████╗████████╗
#                ██║     ██╔══██╗██╔════╝╚══██╔══╝
#                ██║     ███████║███████╗   ██║   
#                ██║     ██╔══██║╚════██║   ██║   
#                ███████╗██║  ██║███████║   ██║   
#                ╚══════╝╚═╝  ╚═╝╚══════╝   ╚═╝   
                                                 
                                                 
                                                
last -da | grep -v ^autologinuser
# Check the whole last login log, but filter out that annoying user that must login every minute.

last -da | grep -vE "^(root|reboot|asmith) "
# See the last logged in users, but filter out entries for root, reboots and asmith.

last -da | awk '{print $1 " " $NF}' | sort | uniq -c 
# Analyze your whole lastlog to see the different remote hosts for each user.

last -da|cut -c27-30|uniq|awk -v y=$(date +%Y) '{if(/Jan/){print $0;print "-- " y--}else{print}}' 
# Jeez, how far back do these lastlogs go?

# A newer option of the last command allows you to print the users who were logged in at a specific time. So you may find the culprit for an incident. Note that logs might be rotated.
last -p "2019-06-04 01:31:00" 

# Count how many times everyone logged in to a system this month
last | cut - d' ' - f1 | uniq -c | sort -n

#==============================##==============================#
# CMD LAST						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░