I'm trying execute this:
Process p = Runtime.getRuntime().exec("ps -ef | grep bash");
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = r.readLine()) != null) {
System.out.println(line);
}
and want see some lines, but it return Null
.
If I execute just "ps -ef"
it return all process correct.
Generally I need to send keyword to method, that return work process or not