Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to communicate with other users on the Linux command line

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to communicate with other users on the Linux command line". In daily operation, I believe many people have doubts about how to communicate with other users on the Linux command line. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to communicate with other users on the Linux command line". Next, please follow the editor to study!

Sending messages to other users on the Linux command line is simple, and many commands can do this, but the trouble is that you need to pick the right one from among the many commands to use. Therefore, I have selected four commonly used Linux user communication commands to share with you and show you how these four commands work.

Wall

The wall command (which means write all) allows you to send information to all users who are logged in to the system. Any user can use the wall command, but the wall command is usually used by the system administrator to send notification notifications to the user (for example, the server will shut down maintenance).

A system administrator may send the following message:

$wall The system will be going down in 15 minutes to address a serious problem

Then, all logged-in users can see notifications like this:

Broadcast message from admin@dragonfly (pts/0) (Thu Mar 5 08:56:42 2020): The system is going down in 15 minutes to address a serious problem

If you want to send a message with single quotation marks, you need to enclose the message to be sent in double quotation marks, as shown below:

$wall "Don't forget to save your work before logging off"

In the command shown in the above example, the outermost quotation marks are not displayed when the message is transmitted, but if there is no outermost quotation mark, the command will wait for a quotation mark paired with the single quotation mark in the sentence to end the sentence.

Mesg

If for some reason you want to reject a message from a user, you can use the mesg command. This command should be used with the parameter n or y, which means to reject or accept a letter from a user, respectively. The use case is as follows (alvin is the user name):

$mesg n alvin $mesg y alvin

It is worth noting that after blocking users with the mesg command, the blocked users will not be notified that they have been blocked, that is, the blocked users will not know that they have been blocked.

You can also use this command to accept or block communications from all users by omitting the user name parameter:

$mesg y $mesg n

Write

Another command that can send text messages directly without having to convert them to email is write. This command can be used to communicate with a specific user. For example, if you want to send a message to a user whose user name is alvin, you can use the following command:

$write alvin Are you still at your desk? I need to talk with you right away. ^ C

Press ctrl+C to exit after writing the sending message. This command allows you to send messages, but instead of opening a duplex channel, it can only be used to send messages. If the receiving user logs in on more than one terminal, you can select a terminal you want to transmit or rely on the system to select a terminal transmission that takes the least time, as follows:

$write alvin#1

If you are blocked by the user alvin, you will see the following prompt:

$write alvin write: alvin has messages disabled

Talk / ytalk

The talk and ytalk commands allow you to establish interactive communication with one or more users, where the talk command allows you to establish interactive communication with only one user. Both the talk and ytalk commands launch a dual-layout window, and each party of the communication can enter information in the upper section of the window and see the response message in the lower section.

The party requested to join the communication can respond to the communication by entering talk and followed by the user name of the initiator of the communication, as follows:

Message from Talk_Daemon@dragonfly at 10:10... Talk: connection requested by alvin@127.0.0.1. Talk: respond with: talk alvin@127.0.0.1$ talk alvin

It is worth noting that when the system has both talk and ytalk installed, the talk command is associated with the ytalk command by default, so when you type talk alvin, the system actually executes ytalk alvin. Since both commands are installed on my system, the output I see after executing the above command is actually ytalk alvin:

-- = YTalk version 3.3.0 =-- Is the report ready?-- = root@lxlinux =- -Just finished it

The above is the window information seen by the user alvin, while the window content seen by the root on the other side of the communication is the reverse:

-- = YTalk version 3.3.0 =-- Just finished it-- = alvin@lxlinux =- -Is the report ready?

Similarly, this command is terminated with ctrl+C.

To use this command to communicate with users of other systems, you need to add a parameter of-h, the parameter value, host name, or IP address. The use cases are as follows:

$talk-h 192.168.0.11 alvin

Summary

The Linux system has many commands that can be used to send information to logged-in users. These commands are very useful in some situations, such as broadcasting information with wall and conducting interactive talks between two users with talk. They all allow users to exchange information quickly. Learning to use these commonly used commands can make communication between users more convenient and improve the efficiency of communication.

Finally, I hope the content of this article will be helpful to your work, if you still have any questions about these commands, please leave a message and let me know!

At this point, the study on "how to communicate with other users on the Linux command line" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report