"Last" command: How to show latest user login?

Thomas

As I know, the last command shows recent logins by all users. But my PC (CentOS) has been used for roughly a year, and there are many users logged. I tried to used the last command, but it just showed from June 2013 to September 2013.

My question is: how can I show the latest users that have logged in recently, say (December 2013 through Jan 2014)?

mkc

last reads from a log file, usually /var/log/wtmp and prints the entries of successful login attempts made by the users in the past. The output is such that the last logged in users entry appears on top. In your case perhaps it went out of notice because of this.

In order to check when was the file /var/log/wtmp was written last, you can use stat command:

stat /var/log/wtmp

In order to print the output in reverse, you can pipe output of last to GNU tac (opposite of cat) as follows:

last | tac

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to show user login name on the next page

分類Dev

Display second last record in TextBox (show user when he last Login)

分類Dev

How do I use row_number in Hive query to get the latest user login?

分類Dev

Angular 4: Redirecting user to last visited page in previous session on login

分類Dev

show logout button along with the name of user after successfull login

分類Dev

How to show last git commit of files

分類Dev

How can I save the last command to a file?

分類Dev

How to use the last command in the while loop?

分類Dev

How to show latest events based on JSON list and current time?

分類Dev

How to login user to a google webpage after successful OAuth 2.0 login?

分類Dev

How to find total login times for a user?

分類Dev

How to request user login in models or views

分類Dev

How to get User session in Login handling in Django?

分類Dev

How to disable the login password for a specific user?

分類Dev

How to Update last added row based on user?

分類Dev

How to trigger latest Android Systrace command's markers for jank and frames?

分類Dev

"if message/text exists in database", then show the message that the user created from latest to oldest

分類Dev

How to show only specific directory to FTP user

分類Dev

In Ajax how to show validation of the input that the user interacts with?

分類Dev

how to group by a user and show their following in python

分類Dev

How to Show Live Location of User in SignalR?

分類Dev

How to show content belonging to current user

分類Dev

redirect to next/route action, not the last after user login/registration symfony security

分類Dev

if first user already login, how to prevent second user login on another tab

分類Dev

How to block a common user use startx command?

分類Dev

How to use xargs with a command that requires user input?

分類Dev

How to use xargs with a command that requires user input?

分類Dev

Why do my gvfs mounts not show up under ~/.gvfs or /run/user/<login>/gvfs?

分類Dev

How to enter login information for a website from the linux command line

Related 関連記事

  1. 1

    How to show user login name on the next page

  2. 2

    Display second last record in TextBox (show user when he last Login)

  3. 3

    How do I use row_number in Hive query to get the latest user login?

  4. 4

    Angular 4: Redirecting user to last visited page in previous session on login

  5. 5

    show logout button along with the name of user after successfull login

  6. 6

    How to show last git commit of files

  7. 7

    How can I save the last command to a file?

  8. 8

    How to use the last command in the while loop?

  9. 9

    How to show latest events based on JSON list and current time?

  10. 10

    How to login user to a google webpage after successful OAuth 2.0 login?

  11. 11

    How to find total login times for a user?

  12. 12

    How to request user login in models or views

  13. 13

    How to get User session in Login handling in Django?

  14. 14

    How to disable the login password for a specific user?

  15. 15

    How to Update last added row based on user?

  16. 16

    How to trigger latest Android Systrace command's markers for jank and frames?

  17. 17

    "if message/text exists in database", then show the message that the user created from latest to oldest

  18. 18

    How to show only specific directory to FTP user

  19. 19

    In Ajax how to show validation of the input that the user interacts with?

  20. 20

    how to group by a user and show their following in python

  21. 21

    How to Show Live Location of User in SignalR?

  22. 22

    How to show content belonging to current user

  23. 23

    redirect to next/route action, not the last after user login/registration symfony security

  24. 24

    if first user already login, how to prevent second user login on another tab

  25. 25

    How to block a common user use startx command?

  26. 26

    How to use xargs with a command that requires user input?

  27. 27

    How to use xargs with a command that requires user input?

  28. 28

    Why do my gvfs mounts not show up under ~/.gvfs or /run/user/<login>/gvfs?

  29. 29

    How to enter login information for a website from the linux command line

ホットタグ

アーカイブ