In Unix, how can I find out login statistics for myself or others?

The Unix command last displays a list of previous logins for all system users. Entered by itself, the last command will display logins of every type, for every individual, possibly going back months. For a more manageable search, add a maximum lines tag that limits the number of logins listed. At the Unix prompt, enter:

  last -n

Replace n with a number. For example, if you wanted a list of the last 30 people to log into the computer on which you are currently working, at the Unix prompt, you would enter:

  last -30

You can also specify a user by entering his or her username after the maximum lines tag. For example, if you are looking for the times user hsolo was logged in, but you are only interested in the last 10 logins, you would enter:

  last -10 hsolo

Different implementations of Unix deliver different kinds of information and may have different options and tags available. For more information, read the man page entry for the last command. At the Unix prompt, enter:

  man last
Note:
The last command works only on logins to the node you are using. You cannot log into one node and request login information for a different node.

At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?

This is document aaoe in the Knowledge Base.
Last modified on 2017-05-16 11:51:05.

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.

Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.