1MESG(1)                          User Commands                         MESG(1)
2
3
4

NAME

6       mesg - display (or do not display) messages from other users
7

SYNOPSIS

9       mesg [option] [n|y]
10

DESCRIPTION

12       The mesg utility is invoked by a user to control write access others
13       have to the terminal device associated with standard error output. If
14       write access is allowed, then programs such as talk(1) and write(1) may
15       display messages on the terminal.
16
17       Traditionally, write access is allowed by default. However, as users
18       become more conscious of various security risks, there is a trend to
19       remove write access by default, at least for the primary login shell.
20       To make sure your ttys are set the way you want them to be set, mesg
21       should be executed in your login scripts.
22
23       The mesg utility silently exits with error status 2 if not executed on
24       a terminal. In this case executing mesg is pointless. The command line
25       option --verbose forces mesg to print a warning in this situation. This
26       behaviour has been introduced in version 2.33.
27

ARGUMENTS

29       n
30           Disallow messages.
31
32       y
33           Allow messages to be displayed.
34
35       If no arguments are given, mesg shows the current message status on
36       standard error output.
37

OPTIONS

39       -v, --verbose
40           Explain what is being done.
41
42       -h, --help
43           Display help text and exit.
44
45       -V, --version
46           Print version and exit.
47

EXIT STATUS

49       The mesg utility exits with one of the following values:
50
51       0
52           Messages are allowed.
53
54       1
55           Messages are not allowed.
56
57       >1
58           An error has occurred.
59

FILES

61       /dev/[pt]ty*, /dev/pts/[0-9]*
62

HISTORY

64       mesg (I) appears in the UNIX Programmer’s Manual. It used to invert the
65       current state with no argument before Version 7 AT&T UNIX.
66

SEE ALSO

68       login(1), talk(1), write(1), wall(1), xterm(1)
69

REPORTING BUGS

71       For bug reports, use the issue tracker at
72       https://github.com/util-linux/util-linux/issues.
73

AVAILABILITY

75       The mesg command is part of the util-linux package which can be
76       downloaded from Linux Kernel Archive
77       <https://www.kernel.org/pub/linux/utils/util-linux/>.
78
79
80
81util-linux 2.39.2                 2023-06-14                           MESG(1)
Impressum