I want to develop a task manager in Ubuntu Linux. I have a task manager in windows that I am running in Eclipse. I am getting the output. But in Linux, what is the equivalent method for "tasklist.exe" to find the processes running?
Please help me..
I want to develop a task manager in Ubuntu Linux. I have a task manager in windows that I am running in Eclipse. I am getting the output. But in Linux, what is the equivalent method for "tasklist.exe" to find the processes running?
Please help me..
you can use the ps
command to determine the user, process, usage and other trivia.
Don't you consider top as an equivalent of tasklist.exe?
ps -ef
will get you all of the tasks running
man ps
will get you all of the options
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class psef
{
public static void main(String args[]) throws Exception
{
try
{
String line;
Process p = Runtime.getRuntime().exec("ps -ef");
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null)
{
System.out.println(line);
}
input.close();
}
catch (Exception err)
{
err.printStackTrace();
}
}
}