as you know "wall" command sends a message to all terminals:

wall message

now my question is this: is there any command that can send a "command" to be run in all terminals?
for example sending clear command to all terminals , so then all terminals will be cleared.

  • KDE's konsole can send input to all tabs (Edit->Copy Input to), but that of course can't work for virtual terminals. – lynxlynxlynx Jul 5 '12 at 12:58
  • 1
    Possible duplicate of Execute command in remote active terminal – George M Jul 5 '12 at 13:26
  • What do you want to do with this and why? – Nils Jul 8 '12 at 21:53

That would be somewhat frightening, but you can send the output of any command to multiple "terminals". For instance, to clear all TTYs that you have access to:

for tty in /dev/ttys00*; do clear > "$tty"; done # OS X (local)
for tty in /dev/pts/*; do clear > "$tty"; done # Linux (Ubuntu, via SSH)
  • For the purpose of the user's example (clearing all terminals), that's enough. – Random832 Jul 5 '12 at 14:26

Cluster SSH.

yum install cssh after activating rpmforge.

  • This isn't even wrong, it has nothing to do with the question. – Gilles Jul 5 '12 at 23:20
  • @Gilles I'm not sure what's wrong with it; it seems fine – Michael Mrozek Jul 6 '12 at 0:17
  • @MichaelMrozek What does coordinating multiple ssh sessions have to do with executing commands in multiple terminals? – Gilles Jul 6 '12 at 0:22
  • @Gilles The description says "ClusterSSH controls a number of xterm windows via a single graphical console window" – Michael Mrozek Jul 6 '12 at 0:25
  • @Gilles to issue actual commands you have to be owner of that terminal. I do not think that the question is about putting text onto a number of terminals. I suspect the questioner wants to do something on a number of machines with a single place to type the according commands. This is what Cluster-SSH is all about. Sadly the questioner has not answered the request for clarification. – Nils Jul 11 '12 at 21:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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