Linux mesg command

Updated: 04/26/2017 by Computer Hope

About mesg

The mesg command allows you control write access to your terminal by other users.

Description

The write command allows other users to send a message to your terminal session; the mesg command is used to toggle these messages on or off.

mesg syntax

mesg [n|y]

Options

n Prevents the display of terminal messages from other users. This option is like using a "do not disturb" sign.
y Allows messages to be displayed on your screen.

If no option is given, mesg displays the current access state of your terminal.

mesg examples

mesg y

Allow other users to send you messages.

mesg n

Disallow other users from being able to send you messages.

mesg

Display the current write status of your terminal.

talk — Talk with other logged in users.
wall — Send a message to all logged-in users.
write — Send a message to another user.