title: How to destroy the subprocess of Java Process
body: <p>I use <code>Runtime.getRuntime().exec</code> to execute command <code>tail -f filename | grep str</code> which is based on OS pipe. I managed to achieve my business logic. But still there is a problem I must solve:
  When using pipe, the Process will for another process for tail command:</p>
  
  <pre><code>$ ps -ef | grep test.log
  admin     6953 32721  0 16:32 ?        00:00:00 /bin/sh -c tail -f /home/admin    
  /test.log | unbuffer -p grep '1444379575648'
  admin     6957  6953  0 16:32 ?        00:00:00 tail -f /home/admin/test.log
  </code></pre>
  
  <p><code>Process.destroy()</code> method destroys itself(<strong>pid:6953</strong>) only.How can I destroy its <code>subprocess(pid:6957)</code> in my Java program?   </p>