Hi
I am running a “last” command and saving the output to a file, which I am going to
ftp to my PC for loading into a DB table.
last > last.txt
I am finding that I am getting lots of duplicate entries for most logins in last.txt.
Eg
userabc pts/3 12.42.35.120 Mon Jun 14 09:17 - 09:19 (03:00)
userabc pts/3 12.42.35.120 Mon Jun 14 09:14 - 09:16 (02:00)
userabc pts/3 12.42.35.120 Mon Jun 14 09:12 - 09:13 (01:00)
userdef pts/2 12.42.35.126 Mon Jun 14 10:27 - 09:28 (01:00)
userdef pts/2 12.42.35.126 Mon Jun 14 10:24 - 09:26 (02:00)
Is there a way to only retrieve the last login for each user ?
Thanks
I am running a “last” command and saving the output to a file, which I am going to
ftp to my PC for loading into a DB table.
last > last.txt
I am finding that I am getting lots of duplicate entries for most logins in last.txt.
Eg
userabc pts/3 12.42.35.120 Mon Jun 14 09:17 - 09:19 (03:00)
userabc pts/3 12.42.35.120 Mon Jun 14 09:14 - 09:16 (02:00)
userabc pts/3 12.42.35.120 Mon Jun 14 09:12 - 09:13 (01:00)
userdef pts/2 12.42.35.126 Mon Jun 14 10:27 - 09:28 (01:00)
userdef pts/2 12.42.35.126 Mon Jun 14 10:24 - 09:26 (02:00)
Is there a way to only retrieve the last login for each user ?
Thanks
Comment