title: linux - write commands from one terminal to another
body: <p>I need to write commands from one terminal to another terminal.</p>
  
  <p>I tried these:</p>
  
  <pre><code>echo -e "ls\n" &gt; /proc/pid/fd/0
  echo -e "ls\n" &gt; /dev/pts/4
  </code></pre>
  
  <p>Which just prints the <code>ls</code> as output and doesn't execute.</p>
  
  <p>I tried these:</p>
  
  <pre><code>chmod 777 /dev/tty4 ;echo "ls" &gt; /dev/tty4
  chmod 777 /dev/tty40 ;echo "ls" &gt; /dev/tty40
  </code></pre>
  
  <p>Which don't seem to do anything</p>
  
  <p>Any ideas?</p>
  
  <p>[note that I don't want to touch the second terminal to accomplish this. only the first one]</p>