mesg(1)

mesg1

Display (do not display) messages from other users

Usage

mesg [{n | y}]

Overview

The mesg utility is invoked by a user to control write access others have to the terminal device associated with the standard error output. Write access is allowed by default, and programs such as talk(1) and write(1) may display messages on the terminal.

The options are as follows:

n

Disallows messages.

y

Permits messages to be displayed.

If no arguments are given, mesg displays the present message status to the standard error output.

Files

/dev/[pt]ty[pq]?

Exit status

The mesg utility exits with one of the following values:

0

Messages are allowed.

1

Messages are not allowed.

1

An error has occurred.

Releases

61 releases since OpenBSD 2.1; the text changed 11 times.

  1. 2.1
  2. 2.2–2.6
  3. 2.7–2.8
  4. 2.9–3.0
  5. 3.1–3.3
  6. 3.4–4.1
  7. 4.2–4.4
  8. 4.5–4.6
  9. 4.7
  10. 4.8
  11. 4.9–6.5
  12. 6.6–8.0

Standards

The mesg utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.

History

A mesg command appeared in Version 1 AT&T UNIX.

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.