This command will tell the last login and reboot related information

This command will reveal login has been made to the system as well as when the reboot occurs. It uses a file called /var/log/wtmp,which captures all the information about the successful login and reboot information. It has many switch ,by which you can get an idea when people login how long they stay.
Sample Output
reboot   system boot  2.6.30-latest    Mon Aug 24 17:51          (00:59)
bhaskar  pts/5                         Mon Aug 24 11:43 - 11:52  (00:09)
bhaskar  pts/5                         Mon Aug 24 11:09 - 11:09  (00:00)
bhaskar  pts/4                         Mon Aug 24 10:12 - 12:35  (02:23)
bhaskar  pts/3                         Mon Aug 24 08:48 - 13:53  (05:05)
bhaskar  pts/1                         Mon Aug 24 08:48 - 13:53  (05:05)
bhaskar  :0           console          Mon Aug 24 08:47 - 13:54  (05:06)
bhaskar  :0                            Mon Aug 24 08:47 - 08:47  (00:00)

2009-08-29 12:08:30

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: