linux wall命令

Fatmawati Achmad Zaenuri/Shutterstock.comFatmawati Achmad Zaenuri / Shutterstock.com

Need to get a quick message out to all logged-in users? Linux’s wall command is punchier than email and auto-targets the logged-in users. It broadcasts a message to everyone using a terminal on a system.

是否需要向所有登录用户快速发送消息? Linux的wall命令比电子邮件更强大,并且可以自动定位已登录的用户。 它使用系统上的终端向所有人广播消息。

墙命令 (The wall Command)

If you need to get a message out—fast—to the logged-in users of your computer, how do you do it? Email doesn’t satisfy the requirements. You don’t know when the email will be read. If you need people to know something right now, that doesn’t cut it. And anyway, you don’t want to clog up the inboxes of logged-out users who don’t need to see the message.

如果您需要快速地向计算机的登录用户发送消息,该如何做? 电子邮件不符合要求。 您不知道何时阅读电子邮件。 如果您需要人们立即了解某些内容,那并不会减少它。 而且无论如何,您都不想阻塞不需要查看消息的已注销用户的收件箱。

Without exerting a bit of extra effort and wasting some time, you’re not going to know who is logged in and from where. Your system could be located in Aberdeen, Washington but you might have remote users logged in from Aberdeen, Scotland. So how can you target a message specifically at the logged-in users?

如果不付出额外的努力和浪费一些时间,您就不会知道谁登录以及从哪里登录。 您的系统可能位于华盛顿的阿伯丁,但您可能有从苏格兰阿伯丁登录的远程用户。 那么,如何才能将消息专门定向到已登录的用户?

Linux and other Unix-like operating systems give you a simple way to do this. The wall command is like a forceful telegram. It will deliver a message to all terminal users, and it dumps the message right under their nose. The users can’t miss it, and you know they’ve got it. You don’t need them to choose to open an application to see if they have a message waiting.

Linux和其他类似Unix的操作系统为您提供了一种简单的方法。 wall命令就像是一封有力的电报。 它将向所有终端用户传递一条消息,并将该消息转储到他们的鼻子底下。 用户不会错过它,而且您知道他们已经了解了它。 您不需要他们选择打开应用程序来查看他们是否有消息等待。

The delivery is as subtle as a custard pie in the face.

交付就像脸上的蛋ust一样微妙。

发送信息 (Sending A Message)

The test machine that this article was researched on was installed with Fedora Linux, but the wall command will behave precisely the same on other distributions.

本文研究的测试机已安装在Fedora Linux上 ,但wall命令在其他发行版上的行为将完全相同。

The one difference you might encounter is some Linux distributions require you to use sudo on the option for sending a message from a text file, while other distributions require you always to use sudo with wall all the time. That’s actually a difference between Linux distributions, not a difference to the operation of the wall command itself.

您可能会遇到的一个区别是,某些Linux发行版要求您在选项上使用sudo从文本文件发送消息,而其他发行版则要求您始终始终将sudowall一起使用。 这实际上是Linux发行版之间的差异,而与wall命令本身的操作没有差异。

To send a message to all users, type wall, a space, then the message you wish to send. With Fedora Linux, you must use sudo.

要将消息发送给所有用户,请键入wall ,一个空格,然后输入您要发送的消息。 对于Fedora Linux,必须使用sudo

sudo wall Main printer offline until further notice.

Your message will be sent out to all users who have a terminal window open.

您的消息将发送给所有打开了终端窗口的用户。

Local users RIa and Tom receive the message, as does remote user Dick, who happens to be working on a computer running Ubuntu.

本地用户RIa和Tom会收到该消息,而远程用户Dick也恰好在运行Ubuntu的计算机上工作。

They all get the message at the same time, and you’re not left wondering whether they’ve seen it.

他们都同时收到消息,您不必怀疑他们是否已看到消息。

从文件发送消息 (Sending a Message From a File)

You can prepare your message in a text file and store it ready to send. If you have a repeating cycle of messages that need to be sent, you can create a library of pre-packed messages so that you don’t need to re-type them again and again.

您可以将消息准备为文本文件,然后将其存储以备发送。 如果您需要重复发送消息,则可以创建一个预包装消息库,这样就不必一次又一次地重新键入消息。

The message in the text file message.txt has been displayed to the terminal window with the cat command to make sure it is the one we want to send.

文本文件message.txt已通过cat命令显示在终端窗口中,以确保它是我们要发送的消息。

The message is then sent by passing the name of the text file to the wall command as a command line parameter:

然后通过将文本文件的名称作为命令行参数传递给wall命令来发送消息:

cat message.txt
sudo wall message.txt

As before, local users Ria and Tom (and everyone else that is logged in with an open terminal window), and remote user Dick receive the message.

和以前一样,本地用户Ria和Tom(以及使用打开的终端窗口登录的所有其他用户)和远程用户Dick都会收到此消息。

讯息礼节 (Messaging Etiquette)

Because the wall command will push the message out to all terminal users no matter what, it can be a jarring experience to receive one. Use of the wall command should be kept to a minimum and only used where there is a genuine need. Otherwise, it will rapidly become very grating.

因为wall命令无论如何都会将消息推送给所有终端用户,因此接收消息可能是一种令人不快的体验。 应该尽量减少使用wall命令,并且仅在真正需要的情况下使用。 否则,它将Swift变得非常刺眼。

A wall message will stamp over whatever else is on the user’s terminal. It doesn’t actually overwrite anything–it won’t change the text it has landed on top of—but it will obscure it. And that can be alarming for a user that doesn’t know this.

wall消息会盖在用户终端上的其他内容上。 它实际上并不会覆盖任何内容,也不会更改它上面放置的文本,但是会使其模糊。 对于不知道这一点的用户,这可能会令人震惊。

Imagine one of our local users is editing an important file in Vi just as the wall message is sent.

试想一下,我们的本地用户的一个编辑的一个重要文件, Vi只为wall发送消息。

The message arrives right in the middle of her file.

邮件将立即到达她文件的中间。

All our user needs do to restore the correct view of the file is to page up and down a little way through the file.

用户要恢复文件的正确视图所要做的就是在文件中上下翻页。

It’s easy enough to restore the display to a state where work can continue, and blood pressure can recede, but too many interruptions of that sort are going to leave you with a very riled set of users.

将显示恢复到可以继续工作的状态很容易,并且血压可以降低,但是这种中断太多会给您带来非常生气的用户。

So, as handy as wall is, use it in considered moderation.

因此,就像wall一样方便,请适度使用它。

图形桌面用户呢? (What About Graphical Desktop Users?)

The wall command reaches everyone logged in with a terminal open, but it won’t reach anyone who’s using a graphical desktop environment without a terminal window open.

wall命令可用于在打开终端的情况下登录的每个用户,但在未打开终端窗口的情况下,不会访问正在使用图形桌面环境的任何用户。

If someone is using a graphical desktop and has a terminal window open, they’ll see it in the terminal window—but that’s it. Don’t count on wall to reach anyone outside of the terminal.

如果某人正在使用图形桌面并且打开了终端窗口,那么他们会在终端窗口中看到它-就是这样。 做不算wall到达终点的人之外。

Subtle it isn’t, but you can’t deny it does get the message across—in a traditional terminal environment, that is.

并非如此,但您不能否认它确实在整个传统终端环境中传达了信息。

翻译自: https://www.howtogeek.com/415914/how-to-use-the-wall-command-on-linux/

linux wall命令

linux wall命令_如何在Linux上使用wall命令相关推荐

  1. linux查看图像大小_如何在Linux上调整一批图像的大小?

    linux查看图像大小 Resizing images on Linux with gThumb is easy. However, I have a batch of images inside a ...

  2. 在linux里复制文件命令_如何在Linux上使用“安装”命令复制文件

    在linux里复制文件命令 Fatmawati Achmad Zaenuri/Shutterstock.com Fatmawati Achmad Zaenuri / Shutterstock.com ...

  3. linux ntp时间立即同步命令_如何在 Linux 下确认 NTP 是否同步?

    我假设我你经使用上述链接设置了 NTP 服务器和 NTP 客户端.现在,如何验证 NTP 设置是否正常工作? -- Magesh Maruthamuthu(作者) NTP 意即 网络时间协议(Netw ...

  4. linux重启网卡命令_如何在 Linux 中更改 MAC 地址 | Linux 中国

    在向你展示如何在 Linux 中更改 Mac 地址之前,让我们首先讨论为什么要更改它.-- Dimitrios Savvopoulos 在向你展示如何在 Linux 中更改 MAC 地址之前,让我们首 ...

  5. linux bash 变量_如何在Linux上的Bash中设置环境变量

    linux bash 变量 fatmawati achmad zaenuri/Shutterstock Fatmawati achmad zaenuri / Shutterstock There's ...

  6. linux 开机自动运行命令_如何在Linux终端同时运行多个Linux命令

    在一行中运行两个或多个命令可以节省大量时间,并在Linux中提高效率.在Linux中,有三种方法可以在一行中运行多个命令: ; Command 1 ; Command 2 首先运行Command1,然 ...

  7. linux xargs命令_如何在Linux中使用xargs命令?

    linux xargs命令 The xargs command allows us to pass the output of one command as the input for another ...

  8. linux终端删除文件命令_如何在Linux终端中删除文件和目录

    linux终端删除文件命令 Fatmawati Achmad Zaenuri/Shutterstock.comFatmawati Achmad Zaenuri / Shutterstock.com T ...

  9. linux管道使用_如何在Linux上使用管道

    linux管道使用 Fatmawati Achmad Zaenuri/Shutterstock.comFatmawati Achmad Zaenuri / Shutterstock.com Use L ...

最新文章

  1. C++获取当前时间和计算程序运行时间的方法
  2. php图形图像处理技术
  3. javascript的null 和undifined
  4. 迅速返回页面顶部代码
  5. ROW_NUMBER、RANK()、DENSE_RANK()和OVER的使用
  6. SAP Spartacus category在breadcrumb里显示不正确的一个问题
  7. 基本的MySQL操作
  8. 如果白百何夫妻离婚了,房贷该谁来还?
  9. Android 自定义 ListView 显示网络上 JSON 格式歌曲列表
  10. 如何查找rpm方式安装的软件路径
  11. SQL查询语句中参数带有中文查询不到结果
  12. linux实验的试验环境,Linux基本环境_实验日志解析.docx
  13. matlab构造arma模型,ARMA模型构建及MATLAB实现
  14. 重磅白皮书发布,华为持续引领未来智慧园区建设新模式
  15. VC CDC类的使用 详解
  16. 平板电脑如何刷linux,手把手教你六步刷系统
  17. Python py文件如何调用其他py文件
  18. PDF、Word、Excel文件前端预览实操干货都在这!
  19. 一次 WebResource.axd 异常处理经历
  20. TOP 1比不加TOP慢的疑惑

热门文章

  1. 我有酒,你有故事吗?
  2. 攀藤PM2.5传感器使用定义串口usb数据接收
  3. 变量命名规范--匈牙利命名法,骆驼命名法,帕斯卡命名法
  4. outer apply的用法
  5. linux 进程 ksoftirqd/n 占用cpu 100%
  6. 怎么进DMM日服DMM怎么看DMM小视频
  7. UVA - 10041 Vito's Family
  8. hp服务器的网络显示红叉,惠普笔记本白屏后重启后显示红叉网络信号联不上网的原因?...
  9. Google服务和软件大全
  10. python字符串查找位置_python中怎么返回指定查找字符的位置