当前位置: 技术问答>linux和unix
怎样另一个终端发送信息?
来源: 互联网 发布时间:2017-01-14
本文导语: 我用who命令输出如下 root pst/1 (:0.0) root pst/2 (:0.0) test pst/3 (172.16.19.52) 如何想test用户的终端发送一条“hello”信息? | 1. wall (对若干用户) ...
我用who命令输出如下
root pst/1 (:0.0)
root pst/2 (:0.0)
test pst/3 (172.16.19.52)
如何想test用户的终端发送一条“hello”信息?
root pst/1 (:0.0)
root pst/2 (:0.0)
test pst/3 (172.16.19.52)
如何想test用户的终端发送一条“hello”信息?
|
1. wall (对若干用户)
wall -- send a message to everybody’s terminal.
SYNOPSIS
wall [-n] [ message ]
DESCRIPTION
wall 会将信息传给每一个 mesg 设定为 yes 的上线使用者。信息结束时需加上 EOF (通常用 Ctrl+D)。
OPTIONS
-n Suppresses the normal banner printed by wall, changing it to "Remote broadcast message". This option is only available for
root if wall is installed set-group-id, and is used by rpc.walld(8).
例子 :
传信息"hi" 给每一个登陆的用户:
wall hi
或
wall 回车, 在后面输入内容,然后以Ctrl+D结束输入并把消息广播出去。
2. mesg
mesg - control write access to your terminal
SYNOPSIS
mesg [y|n]
DESCRIPTION
Mesg controls the access to your terminal by others. It’s typically used to allow or disallow other users to write to your terminal
(see write(1)).
3. write (特定用户)
write - send a message to another user
SYNOPSIS
write user [ttyname]
wall -- send a message to everybody’s terminal.
SYNOPSIS
wall [-n] [ message ]
DESCRIPTION
wall 会将信息传给每一个 mesg 设定为 yes 的上线使用者。信息结束时需加上 EOF (通常用 Ctrl+D)。
OPTIONS
-n Suppresses the normal banner printed by wall, changing it to "Remote broadcast message". This option is only available for
root if wall is installed set-group-id, and is used by rpc.walld(8).
例子 :
传信息"hi" 给每一个登陆的用户:
wall hi
或
wall 回车, 在后面输入内容,然后以Ctrl+D结束输入并把消息广播出去。
2. mesg
mesg - control write access to your terminal
SYNOPSIS
mesg [y|n]
DESCRIPTION
Mesg controls the access to your terminal by others. It’s typically used to allow or disallow other users to write to your terminal
(see write(1)).
3. write (特定用户)
write - send a message to another user
SYNOPSIS
write user [ttyname]