Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Thursday, June 13, 2019
 
 

mesg(1)

Name

mesg - permit or deny messages

Synopsis

mesg [-n | -y | n | y]

Description

The mesg utility will control whether other users are allowed to send messages via write(1), talk(1), or other utilities to a terminal device. The terminal device affected is determined by searching for the first terminal in the sequence of devices associated with standard input, standard output, and standard error, respectively. With no arguments, mesg reports the current state without changing it. Processes with appropriate privileges may be able to send messages to the terminal independent of the current state.

Options

The following options are supported:

–n|n

Denies permission to other users to send message to the terminal. See write(1).

–y|y

Grants permission to other users to send messages to the terminal.

Environment Variables

See environ(7) for descriptions of the following environment variables that affect the execution of mesg: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH.

Exit Status

The following exit values are returned:

0

if messages are receivable.

1

if messages are not receivable.

2

on error.

Files

/dev/tty*

terminal devices

/dev/pts/*

terminal devices

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/core-os
Interface Stability
Committed
Standard

See Also

talk(1), write(1), attributes(7), environ(7), standards(7)