Linux: last (past hour only)

last

Open in new window

How can I limit the results to include only login attempts during the past hour only?
LVL 16
hankknightAsked:
Who is Participating?
 
omarfaridConnect With a Mentor Commented:
try this

last | grep "`date | cut -d':' -f1`"
0
 
TintinCommented:
Alternatively

last |grep "$(date +"%b %d %H:")"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.