mesg — Allow or refuse messages

Format

mesg [y] [n]

Description

mesg determines whether other users can send messages to your terminal with talk, write, or similar utilities.

Options

y
Specifies that other people can send you messages.
n
Specifies that other people cannot send you messages.

Examples

  1. To let other people send you messages, issue:
    mesg y
  2. To tell the system not to let other people send you messages, issue:
    mesg n
  3. To display the current setting without changing it, issue:
    mesg

The terminal is determined by the first of standard input, output, or error which is directed to a terminal.

Localization

mesg uses the following localization environment variables:
  • LANG
  • LC_ALL
  • LC_CTYPE
  • LC_MESSAGES
  • NLSPATH

See Localization for more information.

Exit values

0
Receiving messages is currently allowed
1
Receiving messages is not currently allowed
2
Failure due to any of the following:
  • Unknown command-line option
  • Unknown argument
  • An error accessing the terminal

Portability

POSIX.2 User Portability Extension, X/Open Portability Guide, UNIX systems.

Related information

talk, write