Linux User Logon query and Dialog

Source: Internet
Author: User

Query who users currently logged on to the system
[Root @ lyy ~] # Who
Root tty1
Root pts/0 (192.168.197.1)
Login users in column 1
Terminal name in column 2
Column 3 Logon Time
Query the lastlog of the last logon time of each user.
[Root @ lyy ~] # Lastlog
User name port from last login time
Root pts/0 192.168.197.1 4. October 19:29:15 + 0800 2010
Bin ** never logged on **
Daemon ** never logged on **
Pcca tty1 22:09:21 + 0800 2010
Pcca1 tty1 22:09:26 + 0800 2010
Pcca 2 ** never logged on **
Lastlog reads data from the/var/log/lastlog file.
Write between users
Format: write user terminal interface
For example, a user's pc sends a message to the user's pcca.
1. view the interfaces 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.
3. view the situation of the pcca Terminal
[Pcca @ lyy ~] $
Message from pc @ lyy on pts/1...
Hello world !!!
EOF
If you do not want to accept the 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 "Liyy Study Notes"

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.