Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I put a simple echo command in a CLI tty by user1 expecting it to reach user2 who is logged in a separate tty.

echo "Hello, world!" >> /dev/tty5

I expected user2 to get the echo message but nothing shows up.

Does each user get his/her own "set" of tty[1-7]?

Edit: I suspect this may be a permissions issue. I was actually exploring cron jobs and had set a cron job to echo a "hello world" message every minute from user1 logged into tty2 directed to tty5 where user2 is logged in but user2 never got the echoed messages.

share|improve this question
No. See construct-a-command-by-putting-a-string-into-a-tty. – user13742 Dec 30 '12 at 19:12
Have a look at the write command. That's more along the line of what you want. – Max Dec 30 '12 at 19:24
What shell are you using? Did you get any error message? What is the output of echo "Hello, world!" >> /dev/tty5; echo $?? – Gilles Dec 30 '12 at 23:44
@Gilles It's Bash for both users. System is a Centos 6.3 installation. – haziz Dec 31 '12 at 1:12

If user2 is logged into tty5, he is the owner of /dev/tty5. If he has messaging enabled, then you can send him a message using write user2, but if he doesn't, you're out of luck unless you are root. echo "Hello, world!" >> /dev/tty5 only works if executed by root or by user2.

share|improve this answer
mesg y will enable receiving messages and mesg n will disable it.. – Gert van den Berg Dec 31 '12 at 8:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.