Query the users currently logged on to the system

Source: Internet
Author: User
Query who logged on to the system [root @ lyy ~] # Whoroottty12010-12-0919: 16 rootpts/02010-12-0919: 29 (192.168.197.1) first column login user second column terminal name third column login time query per...
Query who logged on to the system [root @ lyy ~] # Who root tty1 root pts/0 (192.168.197.1) the first column is used to log on to the user. The second column is the terminal name. The third column is used to query the last logon time of each user. lastlog [root @ lyy ~] # Lastlog username port from the last logon time root pts/0 192.168.197.1 4 19:29:15 on April 9 + 0800 2010 bin ** never logged on ** daemon ** never logged on ** pcca tty1 22:09:21 on April 1 + 0800 2010 pcca1 tty1 22:09:26 on April 9, 0800 + 2010 PCCA 2 ** never logged on ** lastlog reads data from the/var/log/lastlog file and writes the data between users. format: write user terminal interface example: User pc sends information to user pcca 1. view the interface of the pcca terminal on the pc terminal [pc @ lyy ~] $ Who root tty1 pcca pts/0 (192.168.197.1) # The pcca terminal interface is pts/0 pc pts/1 (192.168.197.1) 2. use write to send the message hello world [pc @ lyy ~] $ Write pcca pts/0 hello world !!! [Pc @ lyy ~] $ Press Ctrl + d after the input is complete. 3. view the situation of the pcca terminal [pcca @ lyy ~] $ Message from pc @ lyy on pts/1 at... hello world !!! If you do not want to accept the EOF information, you can use mesg n to disable it. information except root is not received. Send Broadcast information to all logged-in users. wall [pc @ lyy ~] $ Wall "I will shutdown my linux server. "Broadcast message from pc (pts/1) (Thu Dec 9 19:47:35 2010): I will shutdown my linux server. in this way, all people can receive the message. Author: yingbin920

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.