Summary of query Current user commands in Linux hosts

Source: Internet
Author: User

Summary of commands for querying the current user in Linux

1, w command to view the current user

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M02/91/A2/wKiom1j3IRrAwLzSAAA4v5ZfK70169.png-wh_500x0-wm_ 3-wmp_4-s_2657646646.png "title=" W.png "alt=" Wkiom1j3irrawlzsaaa4v5zfk70169.png-wh_50 "/>

[Email protected]/]# W

04:31:52 up 1:45, 2 users, load average:0.00, 0.01, 0.05

USER TTY from [email protected] IDLE jcpu PCPU

Root tty1 02:46 1:45m 0.02s 0.02s-bash

Root pts/0 192.168.146.1 03:19 0.00s 0.10s 0.02s W

The first line is: Current time, from boot to now how long, load balancing

The second line is: Description of each column
The third line is: root User login information


2. Who command to view the users on the host

650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M01/91/A2/wKioL1j3I7SDzBQHAAAdlTqdYt0956.png-wh_500x0-wm_ 3-wmp_4-s_3933429255.png "style=" float:left; "title=" Who.png "alt=" Wkiol1j3i7sdzbqhaaadltqdyt0956.png-wh_50 "/>



[email protected]/]# who

Root Tty1 2017-04-19 02:46

Root pts/0 2017-04-19 03:19 (192.168.146.1)

"Attached": see who is currently logged on user

WHOAMI (no spaces between letters)

650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/91/A2/wKioL1j3JQqBZVmiAAAKsK3UYMg466.png "title=" Whoami.png "alt=" Wkiol1j3jqqbzvmiaaaksk3uymg466.png "/>

3. Lastlog command to view the users on the host

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/91/A3/wKiom1j3JC-RfSUQAACPruqRJeA858.png "title=" Lastlog.png "alt=" Wkiom1j3jc-rfsuqaacpruqrjea858.png "/>

[Email protected]/]# Lastlog | Head-n 15

Username Port from Latest

Root pts/0 192.168.146.1 Wed Apr 19 03:19:47-0400 2017

Bin **never Logged in**

Daemon **never logged in**

ADM **never logged in**

LP **never logged in**

Sync **never logged in**




















This article is from the "12300166" blog, please be sure to keep this source http://12310166.blog.51cto.com/12300166/1917455

Summary of query Current user commands in Linux hosts

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.