Solved

Linux: last (past hour only)

Posted on 2013-11-14
2
342 Views
Last Modified: 2013-11-15
last

Open in new window

How can I limit the results to include only login attempts during the past hour only?
0
Comment
Question by:hankknight
2 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 39650144
try this

last | grep "`date | cut -d':' -f1`"
0
 
LVL 48

Expert Comment

by:Tintin
ID: 39652914
Alternatively

last |grep "$(date +"%b %d %H:")"
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now