Communication between Linux logged-on users (terminals)

Source: Internet
Author: User

Reproduced

1. Write command

Usage rights: All users
How to use:
Write user [ttyname]
Note: The write command transmits information to another user who is logged into the system, and when the input is complete, type EOF (CTRL+D) to end the message, and the write instruction transmits the message to the other person. If the user who receives the information is not only logged in to the local host once, you can specify the terminal number to receive the information.
  
Parameters:
User: Pre-user account for the messaging
Ttyname: If the user has more than two TTY connections at the same time, you can choose the appropriate TTY messaging

For example: Use the #w command to view the currently logged-on user:

If the input TTY shows the current under PTS/1, then we want to send a message to root under PTS/2, enter the command: Write root PTS/2 press ENTER after entering information, you can see PTS/1:

and the terminal under PTS/2 can see:

Press Crtl+d to end the input.

Of course, we can also direct input to the write root

Note that using the Write command should first use MESG (MESG y allows WRITE,MESG N does not allow write) to see if it is displayed, such as:

If it is no, you should first use MESG Y, such as:

2. Wall command

Wall--Send a message to everybody ' s terminal (broadcast a message to all logged-in terminals)
Synopsis
Wall [-n] [message]
DESCRIPTION
Wall will pass the message to every online user who has MESG set to Yes. At the end of the message, you need to add EOF (usually ctrl+d).
OPTIONS
-N suppresses the normal banner printed by wall and changing it to "Remote broadcast message".

This option is a available for root if wall are installed Set-group-id, and is used by RPC.WALLD (8).

For example:

Input command: Wall Hello, a "hello" message will be received at each login terminal.

3. MESG instruction
MESG command: Whether to allow other users to send themselves messages with the Write command. If you are allowed to send messages to yourself, enter the command:
# MESG Y
Otherwise, enter:
# MESG N for Superuser, the default value for the system is n, and the default value for the general user system is Y.

4, who am I/tty can display terminal information, WhoAmI display the current user name

Communication between Linux logged-on users (terminals)

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.