🖥️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.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ 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 #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command last in a clear format. This allows users to quickly access the needed information for last without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for last are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.