-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux last Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to last on Linux, covering Arch Linux, CachyOS, and other distributions including login history, system reboots, and user activity logs.
last shows login history.
Uses:
- Login history: See past logins
- Reboot history: System reboots
- User activity: Track user logins
- Security audit: Review access
Why it matters:
- Security: Monitor access
- Troubleshooting: Debug login issues
- Audit: Track system usage
Show logins:
# Show login history
last
# Shows:
# - Username
# - Terminal
# - Login time
# - Logout time
# - DurationUser history:
# Show user logins
last username
# Show root logins
last rootLimit output:
# Show last 10 logins
last -n 10
# Or
last | head -10Time range:
# Show since date
last -s 2024-01-01
# Show until date
last -t 2024-01-31System reboots:
# Show reboots
last reboot
# Show shutdowns
last shutdownBoot details:
# Show with details
last -F reboot
# Full timestamp formatCheck installation:
# Check last
which last
# Usually in util-linux
# Install if missing
sudo pacman -S util-linuxCheck logs:
# Check wtmp
ls -la /var/log/wtmp
# Check utmp
ls -la /var/run/utmpThis guide covered last usage, login history, and system reboot tracking for Arch Linux, CachyOS, and other distributions.
- who Guide - Current users
- w Guide - User activity
- Log Management - System logs
-
last Documentation:
man last
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.