LinuxShell控制台向其它用户发消息可以用 `write` 和 `wall`

本文介绍了在Linux系统中如何使用write命令向特定用户发送消息,以及wall命令广播消息给所有用户。同时,展示了通过w命令查看当前登录用户及其活动的详细信息。这些是Linux终端交互和系统管理的基础操作。
摘要由CSDN通过智能技术生成
向其它用户发消息可以用 writewall
write 向指定用户发消息
write user001 #回车
输入要发送的信息后回车
按 两次CTRL+D 或者 一次CTRL+C

wall 向所有用户发消息
wall hello world 回车

加双引号多行

wall "这是多行消
来自root
第一行
第二行"

先执行wall命令, 然后输入文本, 再按 Ctrl+d 发送

wall 回车
输入消息
按  `Ctrl+d` 发送

查看有哪些用户登录控制台的命令是 w

例如

[root@FedoraServer36 sshd_config.d]# w
 08:25:38 up 58 min,  4 users,  load average: 0.00, 0.02, 0.08
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
z        tty1      07:27   50:25   0.04s  0.04s -bash
z        pts/0     07:31   46:26   0.01s  0.01s -bash
root     pts/1     07:36    1.00s  0.03s  0.00s w
z        pts/2     07:41   44:26   0.01s  0.01s -bash
[root@FedoraServer36 sshd_config.d]# type w
w 已被录入哈希表 (/usr/bin/w)
[root@FedoraServer36 sshd_config.d]# which w
/usr/bin/w
[root@FedoraServer36 sshd_config.d]# w --help

Usage:
 w [options]

Options:
 -h, --no-header     do not print header
 -u, --no-current    ignore current process username
 -s, --short         short format
 -f, --from          show remote hostname field
 -o, --old-style     old style output
 -i, --ip-addr       display IP address instead of hostname (if possible)

     --help     display this help and exit
 -V, --version  output version information and exit

For more details see w(1).
[root@FedoraServer36 sshd_config.d]#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kfepiza

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值