Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools OS wall #115

Open
junxnone opened this issue Mar 24, 2023 · 0 comments
Open

Tools OS wall #115

junxnone opened this issue Mar 24, 2023 · 0 comments

Comments

@junxnone
Copy link
Owner

junxnone commented Mar 24, 2023

wall

  • 向所有终端广播信息
$ wall --help

Usage:
 wall [options] [<file> | <message>]

Write a message to all users.

Options:
 -g, --group <group>     only send message to group
 -n, --nobanner          do not print banner, works only for root
 -t, --timeout <timeout> write timeout in seconds

 -h, --help              display this help
 -V, --version           display version

For more details see wall(1).

UseCase

  • 需要重启时,提前广播信息

简单广播

  • 用户发送如下命令
$ wall "The system will be restarted in 10 minutes."
  • 其他终端会收到如下命令
Broadcast message from xxx@xxx (pts/0) (Fri Mar 24 10:22:32 2023

The system will be restarted in 10 minutes.

隐藏 第一行信息 -n

  • 需要 root 用户 或 sudo 权限
$ sudo wall -n "The system will be restarted in 10 minutes."

广播到 Group -g

  • devs group 广播
$ wall -g devs "The system will be restarted in 10 minutes."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant