how to run multiple unix command consecutively in single runtime in java
<p>I have a requirement to execute multiple Unix commands consecutively in a single runtime in the Java environment.</p>

<p>Let me describe you how many commands it would be below:</p>

<pre><code>1. `sudo user`
2. `cd 'specified directory'`
3. `chmod -R 777` [to a directory under path specified in step 2.]
</code></pre>

<p>I need something like this mentioned below:</p>

<pre><code>Process p = Runtime.getRuntime().exec(1 and 2 and 3);
p.waitFor();
p.destroy();
</code></pre>

<p>Please suggest me how should I approach?</p>