Which of the following commands will write a message to the terminals of all logged in users?
Correct Answer: D
Explanation
The wall command is a command-line utility that displays messages to all logged-in users on the terminal12.
The wall command takes the following basic syntax:
$ wall OPTION { file | message }
The OPTION can be one of the following:
* -n or --nobanner: Suppress the banner (the header line with the hostname, date, and time) from the output. This option can only be used by the root user.
* -v or --version: Display version information and exit.
* -h or --help: Display help message and exit.
The file or message argument is the source of the message to be displayed. If a file is specified, the wall command will read the message from the file. If a message is specified, the wall command will read the message from the standard input. The message can be terminated by pressing Ctrl+D.
The other commands in the options are not valid or do not have the same functionality as the wall command:
* bcast: There is no such command in Linux.
* mesg: This command is used to control write access to the terminal. It does not send messages to other users.
* print: This command is used to print files or data to a printer. It does not send messages to other users.
* yell: There is no such command in Linux.
References:
1: How to Send a Message to Logged Users in Linux Terminal - Tecmint 2: How to Send Broadcast Messages to Users in Linux Terminal