![]() ![]() p = new ProcessBuilder(command).start() īufferedReader br = new BufferedReader īr = new BufferedReader(new InputStreamReader(p.getErrorStream())) īr = new BufferedReader(new InputStreamReader(p. To execute these kind of commands in java language, you have to use Runtime.exec () or ProcessBuilder. You can actually change the filtering condition on grep to find any kind of process. To execute these kind of commands in java language, you have to use Runtime.exec() or ProcessBuilder. The command ps -ef grep tomcat list out the processes which contains the word tomcat in the argument of the process. This means if it's a java process then the java command will be present in the output and that's what we are searching for using the grep command. ![]() Mat at 18:03 3 If you know there is ps then first try man ps, info ps and learn about it in the Internet. user 17809 16492 7 21:28 pts/1 00:00:00 java JNITest user 17821 14042 4 21:28 pts/2 00:00:00 bash user 17845 17821 0 21:28 pts/2 00:00:00 ps -ef Thanks. 1 please show a bit more effort in researching this and describing your problem, there are a lot of possibilities depending on what exactly you're after. args COMMAND command with all its arguments as a string. (see cpu) tname TTY controlling tty (terminal). The Linux ps manpage, for example, gives: c C integer value of the processor utilisation percentage. Here is the type of output I am after: B ps -ef. 4 Answers Sorted by: 26 You can check the manpage using man ps to find out what the columns mean. ![]() The command ps -ef | grep tomcat list out the processes which contains the word tomcat in the argument of the process. Can anyone help I am trying to follow these procedures. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |