Ritesh Dwa wrote:It works if I use "ps -ef" as command.
OK, so use that. I presume you're familiar with
String.matches().
However, on a general note,
Java was
never designed for running system commands; indeed, it runs contrary to the whole ethos of Java -
portability.
Your solution, for example, will only work on a Unix/Linux system.
On the other hand, it should be a very simple matter to write a script that runs the pipeline you want and sends the output of
that to a Java program.
Winston