通信码农,Emacs爱好者,业余IOS程序员,更业余的PM
全部博文(111)
分类: 其他平台
2013-04-08 10:47:34
Sometimes as the administrator of a Linux Operating System Server, you may need to send a message to all users. There are some different ways to do this, and now we will see just one of them.
We will use wall.
As the main input of wall is a file, we will first create our message file.
For example: you want to tell users that in two more hours the main SQL database is going to be unavailable because of maintenance.
So type:
echo 'Please note that in two more hours, and for one hour, you will not be able to use the SQL database, please save all your job before, and quit any application using it.' > message.txt
OK, now we have our message ready, it is time to send it to the users.
wall < message.txt
And something like this will appear on all terminals open.
Broadcast Message from
(/dev/pts/3) at 9:56 ...
Please note that in two more hours, and for one hour, you will not be able to u
se the SQL database, please save all your job before, and quit any application
using it.
More, you can use pipe to implement it, which is the left job to you.
转自 http://lichengwulove.blog.163.com/blog/static/846483112010101415916297/