List of Java processes

2019-01-29 22:43发布

How can I list all Java processes in bash? I need an command line. I know there is command ps but I don't know what parameters I need to use.

16条回答
可以哭但决不认输i
2楼-- · 2019-01-29 23:03

try:

ps aux | grep java

and see how you get on

查看更多
做自己的国王
3楼-- · 2019-01-29 23:05
 ps -eaf | grep [j]ava

It's better since it will only show you the active processes not including this command that also got java string the [] does the trick

查看更多
乱世女痞
4楼-- · 2019-01-29 23:07

ps aux | grep java

or

$ ps -fea|grep -i java

查看更多
Fickle 薄情
5楼-- · 2019-01-29 23:08

I use this (good on Debian 8): alias psj='ps --no-headers -ww -C java -o pid,user,start_time,command'

查看更多
一夜七次
6楼-- · 2019-01-29 23:11

You can use single command pgrep as well (doesn't require you to use pipes and multiple commands):

pgrep -fl java
查看更多
够拽才男人
7楼-- · 2019-01-29 23:11

To know the list of java running on the linux machine. ps -e | grep java

查看更多
登录 后发表回答