(ix) Linux view commands for user login

Source: Internet
Author: User

User Login View command

W

Meaning: As simple as this, a letter W is a command. View logged-in user information.

Meaning of the result of the output:

Username for user Login

TTY Login Terminal

from which IP address to log in

[Email protected] Login time

Idle User Inactivity Time

JCPU refers to the time taken by all processes connected to the terminal, and this time does not include the past background

Job time, but includes the time taken by the currently running background job

PCPU the time that the current process takes

What is the command that is currently running

Consider a practical example, as follows:

This indicates that there are currently two logged-in users, both root. One is logged on natively (that is, tty1) and one is Telnet (that is, pts/0).

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

W.H.O.

Meaning: This command is also very simple, just a word. The same is to view the current logged-on user, but only to display less information.

The results of the output are: User name, login terminal, logon time.

Take a look at the actual, as follows:

Note that only some of the information is displayed when compared to the W command.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Querying user information for current login and past logins

Last

Meaning: The command is also very simple, a word. Queries the system for past logins and current logged-in user information.

Note: The last command reads the data from the/var/log/wtmp file by default, so be aware that this file cannot be viewed with VI.

The output of the command includes: User name, login terminal, login IP, logon time, exit time (online time)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

View the last logon time for all users

Lastlog

Meaning: The command is also very simple, a word. View the last logon time for all users of the system

Note: The Lastlog command reads the data/var/log/wtmp this file by default, so be aware that this file cannot be viewed with VI.

Command output includes: User name, login terminal, login IP, last login time

(ix) Linux view commands for user login

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.