I also tried Linux to make it a chat tool.

Source: Internet
Author: User
I also tried Linux to turn it into a chat tool-Linux Enterprise Application-Linux server application. Here is the details. User discussion: talk, mesg, wall

Can I talk to users on the system? Of course! Use the talk command! However, talk needs to start some additional network services. For the current Linux distribution and network environment, hey! Let's stop playing with this thing ~ If you are sure you want to play with this stuff, please take a look at man talk and start the ntalk service at the same time ??

Apart from direct online chat, is there any other message transmission function? Yes! Using write is a good method! He can directly send the message to the receiver ??? Br/>
For example, we currently have two online users in Linux: vbird and dmtsai:

[Vbird @ linux ~] $ W
16:50:39 up, 2 users, load average: 0.00, 0.00, 0.00
User tty from login @ IDLE JCPU PCPU WHAT
Vbird pts/0 vbird pm 0.00 s 0.06 s w
Dmtsai pts/1 dmtsai 0.07 s 0.01 s man write

When I send a message to dmtsai using vbird, I can do this:

[Vbird @ linux ~] $ Write dmtsai
Hi, How are you doing today ....
Nothing... just say hello to you!
<= Click [ctrl] + d here

At this point, the dmtsai at the other end appears on the terminal interface as follows:

[Dmtsai @ linux ~] $
Hi, How are you doing today ....
Nothing... just say hello to you!
EOF

Strange. A message is immediately sent to dmtsai! However, dmtsai was checking the information. Wow! These messages will immediately interrupt dmtsai's original work! Therefore, if the dmtsai user does not want to accept any message, send this action directly:

[Dmtsai @ linux ~] $ Mesg n

Therefore, when vbird releases write again, the following occurs:

[Vbird @ linux ~] $ Write dmtsai
Write: dmtsai has messages disabled

Call! Understand Hu? If you want to unlock it, just release "mesg y" again! If you want to know the current mesg status, just issue "mesg! Why?

Compared with write, the message is sent to only one user. How can we send the message to users on all systems? Call! Use wall! His syntax is also very simple!

[Root @ linux ~] # Wall "I will shutdown the linux server about 5 m later.
> If you still have to login, please tell me.
> Or I will do it ....."

So, unless your mesg status is n! Then you can receive the broadcast message ??? Br/>
[ This post was last edited by mpuPosi]

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.