• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

mesg Command Examples in Linux

by admin

Users can disallow anyone to send them messages via the mesg utility. Therefore, before you start attempting to send messages, it’s a good idea to check whether messages are allowed. For yourself, you can simply enter the mesg command as follows:

$ mesg
is n
$

The “is n” result shows that messaging is turned off. If the result showed “is y”, messages would be allowed.

If you don’t want to receive any messages from other users, use the mesg command. This command works with two arguments only. mesg n makes sure that no one can write messages to your console. If you want to open your console again for messages from other users, use mesg y.

mesg Command Examples

1. To allow write access to your terminal:

# mesg y 

2. To disallow write access to your terminal:

# mesg n 
Final Thoughts

mesg with argument -n forbids messages via write(1) by revoking nonuser write permission on the user’s terminal. mesg with argument -y reinstates permission. All by itself, mesg reports the current state without changing it.

Filed Under: Linux

Some more articles you might also be interested in …

  1. setsebool: command not found
  2. htpdate Command Examples in Linux
  3. How to kill Processes in Linux using kill, killall and pkill
  4. How to use strace and ltrace commands in Linux
  5. pdftoppm Command Examples in Linux
  6. iw Command Examples in Linux
  7. ntpq: command not found
  8. How to Add Network Printer via Command Line in CentOS/RHEL
  9. whoami: command not found
  10. cpio Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright