Linux Terminal multi-user Communication utility command

Source: Internet
Author: User
Tags local time

a command1.1 Write

This command copies the characters entered by the current terminal (source) to the target user's terminal, thereby sending a message to a user in the system. Use the following:

#Write <user>

<msg>

[Ctrl+d] or [Ctrl + C]

When you execute the Write command, the target user gets a caption in the following format:

Message from source user name @ source host on source character terminal at: Min.

Subsequent input of the word literals will be copied to the specified user's terminal. The target user must also execute the write command if they want to respond.

After the input is finished, type the EOF (CTRL+D) character or the interrupt (CTRL + C) instruction. The target user will see the EOF message indicating the end of the conversation.

When the target user logs on to multiple terminals, you can explicitly specify the target terminal name by using the Write <user> <tty> command. Alternatively, the write command automatically selects the terminal with the shortest idle time (the terminal is usually currently in use).

Note that the talk command is similar to the Write command. This command is a visual communication program that is more complex to use.

1.2 Wall

This command sends a message to all logged-in users on the system. Use the following:

# Wall <msg> or

# Wall

<msg>

[Ctrl+d]

Where the message can be sent directly as a parameter to the wall command, or it can be written to the standard input of the wall command (the message length is limited to 22 lines and must end with the EOF key).

When the message is sent, the target user gets a title and a message in the following format:

Broadcast message from source user name (source character terminal) (Weekday day: minutes: seconds):

< empty line >

Message content

The command ignores the time zone variable, that is, when the caption is printed based on the local time of the system.

1.3 MESG

This command controls write access to the current terminal by other non-root users, such as whether to allow other users to send messages. Use the following:

This command sends a message to all logged-in users on the system. Use the following:

# MESG [Y|n]

Where y is allowed to write to the current terminal, n is forbidden to write. If you do not specify an option y|n, the MESG command outputs the current access state of the terminal.

Two Example

The previous section command uses the following example (The Wall command does not list other users ' terminal displays):

1 [[email protected] ~]$ W 211:30:58 up, 3:45, users, load average:0.12, 1.82, 2.773 USER TTY from [email protected] IDLE jcpu PCPU4Wangxiao pts/1 10.46.44.16 Mon09 0.00s 23.57s 0.00s sshd:wangxiaoyuan_[Priv]5Root PTS/12 10.46.51.170 Mon15 19:49m 0.00s 0. 00s-bash6Litianch pts/15 10.46.44.16 10:42 9:52 0.02s 0. 02s-bash7Litianch pts/22 10.46.44.29 Fri17 20:39m 0.09s 0. 09s-bash8 [[email protected] ~]$ Write Litianchi 9Write:litianchi is logged in more than once; writing to PTS/15 TenHello Tianchi,type ' Write Wangxiaoyuan_ ' and press ENTER One Then enter ' welcome! ' and press Ctrl+d to send the message to me. A //ctrl+c - [[email protected] ~]$  -Message from [e-mail protected] on PTS/1 at 10:43 ... theHello Tianchi,type ' Write Wangxiaoyuan_ ' and press ENTER - Then enter ' welcome! ' and press Ctrl+d to send the message to me. - EOF - //enter + [[email protected] ~]$ Write Wangxiaoyuan_  - welcome! + //ctrl+d A  at [[email protected] ~]$  -Message from [e-mail protected] on PTS/15 at 10:44 ... - welcome! - EOF - //enter - [[email protected] ~]Wall Hello everyone! in  -Broadcast message from Wangxiaoyuan_ (PTS/21) (Fri Oct 31 16:54:56 2014): to  + Hello everyone! -  the [[email protected] ~]$ Wall  * world! $ //ctrl+cPanax NotoginsengBroadcast message from Wangxiaoyuan_ (PTS/1) (Tue Nov 25 11:38:12 2014): -  the world! +  A [[email protected] ~]$Wall "Who's compling, please terminate! Just a test, pls go on ... " the [[email protected] ~]$  +Broadcast message from Wangxiaoyuan_ (PTS/21) (Fri Oct 31 17:25:03 2014): -  $Who's compling, please terminate! Just a test,pls go on ... $  - [[email protected] ~]$ MESG  - is y the [[email protected] ~]$ mesg n  - [[email protected] ~]$ MESG Wuyi is n the [[email protected] ~]$Write Litianchi Pts/15 -Write:litianchi have messages disabled on PTS/15

Three summary

The Write and wall commands described in this article may be used in the following situations:

1) when an exclusive compilation resource is required, a message notification can be sent to not perform the compilation task;

2) The need to compile resources, and other users in the compilation version, you can send a message to suspend the notification;

3) When a user executes a dead loop that consumes a large amount of CPU, a message reminder can be sent out.

It is not recommended to use chat communication between users of Linux systems (including talk commands), after all, too primitive.

Linux Terminal multi-user Communication utility command

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.