title: How to invoke a Linux shell command from Java
body: <p>I am trying to execute some Linux commands from Java using redirection (>&amp;) and pipes (|). How can Java invoke <code>csh</code> or <code>bash</code> commands?</p>
  
  <p>I tried to use this:</p>
  
  <pre><code>Process p = Runtime.getRuntime().exec("shell command");
  </code></pre>
  
  <p>But it's not compatible with redirections or pipes.</p>