will do exactly that:

last -F
# -F     Print full login and logout times and dates.

# output will look like this
# username (who logged in) ip (from which was logged in) duration of session
username pts/0        123.123.123.123     Tue Nov  7 19:26:45 2017 - Tue Nov  7 19:26:55 2017  (00:00)    
username pts/0        123.123.123.123     Tue Nov  7 19:22:57 2017 - Tue Nov  7 19:26:36 2017  (00:03)    
username pts/0        123.123.123.123     Tue Nov  7 19:21:26 2017 - Tue Nov  7 19:22:04 2017  (00:00)    
username pts/0        123.123.123.123     Tue Nov  7 19:12:00 2017 - Tue Nov  7 19:21:06 2017  (00:09)    
root     pts/0        123.123.123.123     Tue Nov  7 19:08:13 2017 - Tue Nov  7 19:11:52 2017  (00:03)    
user     pts/0        123.123.123.123     Tue Nov  7 19:07:28 2017 - Tue Nov  7 19:08:05 2017  (00:00)    
reboot   system boot  3.10.0-693.5.2.e Tue Nov  7 19:07:16 2017 - Sun Nov 12 15:02:40 2017 (4+19:55)   
user     pts/0        123.123.123.123     Tue Nov  7 19:05:47 2017 - Tue Nov  7 19:06:42 2017  (00:00)    
root     tty1                          Tue Nov  7 19:02:35 2017 - Tue Nov  7 19:06:42 2017  (00:04)    
reboot   system boot  3.10.0-693.el7.x Tue Nov  7 19:02:18 2017 - Tue Nov  7 19:06:44 2017  (00:04) 

last.man.txt

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin