0

I used this command in ubuntu to find the last ussers logged in the past 30 minutes:

last -s -30m --fullnames |head -n -1|awk '{print $1}' | sort -u

I need the equivalent for Centos 7.

For CentOS 7 I tried:

lastlog -b 0 -t 1 | awk '{print $1}' 

But I don't know how to convert days to minutes. Is there any way to convert days to minutes in CentOS 7 with lastlog command?

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
  • I looked at the difference between the different versions and neither CentOS's last and lastlog have parameters that could suit your query. You would therefore need to parse the output with some scripting based on the date. – Julie Pelletier Apr 22 '17 at 05:06
  • Your last -s ... command seems to run fine on Centos7. lastlog is not an equivalent of last, see https://unix.stackexchange.com/questions/192078/difference-between-last-and-lastlog – VPfB Apr 22 '17 at 06:04

0 Answers0