{{Short description|Unix command}} {{Lowercase title}} {{notability|Products|date=November 2016}} {{Infobox software | name = mesg | logo = | screenshot = | screenshot size = | caption = | author = Dennis Ritchie,<br />Ken Thompson | developer = AT&T Bell Laboratories | released = {{Start date and age|1971|11|3}} | latest release version = | latest release date = | operating system = Unix and Unix-like | genre = Command | license = | website = }} <code>'''mesg'''</code> is a Unix command that sets or reports the permission other users have to write to the current user's terminal using the <code>talk</code> and <code>write</code> commands.

==Usage== It is invoked as:

<syntaxhighlight lang="bash"> mesg [y|n] </syntaxhighlight>

The 'y' and 'n' options respectively allow and disallow write access to the current user's terminal. When invoked with no option, the current permission is printed.

Input redirection may be used to control the permission of another TTY. For example:

<syntaxhighlight lang="console"> % mesg is y % tty /dev/tty1 % mesg < /dev/tty2 is y % mesg n < /dev/tty2 % mesg < /dev/tty2 is n % mesg is y </syntaxhighlight>

==See also== {{Wikibooks|Guide to Unix|Commands}} *List of Unix commands

==References== *{{man|cu|mesg|SUS}}

{{Unix commands}}

Category:Unix user management and support-related utilities Category:Unix SUS2008 utilities