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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. e2fsck: command not found
  2. dcfldd: Enhanced version of dd for forensics and security
  3. mkfs.vfat: command not found
  4. runlevel Command Examples in Linux
  5. pi Command Examples in Linux
  6. latexmk Command Examples
  7. db_load command – generate db database
  8. How to Boot KVM Guest into a Rescue shell
  9. krita: command not found
  10. func: Azure Functions Core Tools: Develop and test Azure Functions locally

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright