Linux User information Query

Source: Internet
Author: User


(1) Query user information currently logged in W or who
[@bjzw_11_210 ~]#W  -:Geneva: -Up342Days -: on,2Users, load average:0.03,0.04,0.00USER TTY from [email protected] IDLE jcpu PCPU whatroot pts/0    10.149.239.20Thu130.00s0.19s0.00sWGuest pts/2    10.139.239.20Thu15 A: 43m0.02s0.02s-bash

The first line shows the current time, how long the boot (up), the average load of several users on the system, etc.
The second line is the description of each item (column name);
After the third row, each row represents a user. As above, root login, and get the terminal name PTS/0,PTS/1 and so on.

W.H.O. Root     pts/0        -- 10.149.  239.20) root     pts/1        -20 : 10.149.  239.20)
(2) Check the last login time of each account Lastlog
[@tc_62_179 blog_spider]# lastlogusername Port from latestroot pts/1    10.149.239.20Thu Dec7  -: A: ++0800  .bin**never loggedinch**Daemon**never loggedinch**ADM**never loggedinch**LP**never loggedinch**Sync**never loggedinch**shutdown**never loggedinch**Halt**never loggedinch**Mail**never loggedinch**operator**never loggedinch** Games**never loggedinch**FTP**never loggedinch**Nobody**never loggedinch**Avahi-AUTOIPD **never Loggedinch**systemd-bus-proxy **never Loggedinch**systemd-network **never Loggedinch**Dbus**never loggedinch**POLKITD**never loggedinch**ABRT**never loggedinch**Libstoragemgmt**never loggedinch**RPC**never loggedinch**postfix**never loggedinch**PCP**never loggedinch**TSS**never loggedinch**Unbound**never loggedinch**NTP**never loggedinch**Rpcuser**never loggedinch**Nfsnobody**never loggedinch**SSSD**never loggedinch**Chrony**never loggedinch**sshd**never loggedinch**tcpdump**never loggedinch**Oprofile**never loggedinch**Odin pts/0    10.142.239.25Sun Nov A  +: -: One+0800  .Apache**never loggedinch**Netmonitor**never loggedinch**Guest**never loggedinch**NSCD**never loggedinch**

The essence is to view/var/log/lastlog

(3) View information ID of the owner group of the specified user
ID uid=0(root) gid=0Groups=0ID  odinuid=  Odin gid=Groups= (Odin),6(disk)

Linux User information Query

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.