Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mnemonicj

macrumors member
Original poster
Nov 11, 2010
34
0
Hsinchu, Taiwan
Good day people.

I'm currently looking for a command for my terminal that can show me if a certain process is running. I want to be able to filter out the process by name not by running its current PID.

Any chance of that happening?

Regards.
 
Good day people.

I'm currently looking for a command for my terminal that can show me if a certain process is running. I want to be able to filter out the process by name not by running its current PID.

Any chance of that happening?

Regards.
Use Activity Monitor. It's much simpler.
 
Top will do it for you.

To see processes and sort by cpu usage, type:
top -o cpu

This is the listing you get from activity monitor.
 
Agree with top except it only shows the top dozen or so processes. I use PS and grep for the name of the process I'm looking for, ie

Code:
ps -ax | grep python
 
Agree with top except it only shows the top dozen or so processes. I use PS and grep for the name of the process I'm looking for, ie

Code:
ps -ax | grep python

Will grep work with cygwin? Better yet, will this code work work with cygwin at all?
 
Will grep work with cygwin? Better yet, will this code work work with cygwin at all?

Why are you asking about cygwin in an OSX forum? I seem to recall cygwin is a windows thing.

On OSX, ps works just fine. In Windows running under bootcamp or parallels I don't know if ps would work under PS but even if it did work it would only "see" the process inside the windows VM, but I'd have to ask myself why you'd bother with cygwin when you have OSX at your disposal?
 
Are sshing into the mac or windows box? If you are going to the windows box use pstools. There is a utility called pslist that will show you all processes. If you are going to the mac use the suggestions above.
 
Are sshing into the mac or windows box? If you are going to the windows box use pstools. There is a utility called pslist that will show you all processes. If you are going to the mac use the suggestions above.

Thanks a lot for the replies people. I am using a Mac to connect to a windows box and vice-versa. I'll try these commands and post back. I'll look into pstools.
 
All of the above suggestions work on my Mac and I know this isn't the place to post about Cygwin, but unfortunately the commands you all mentioned do not work on it. Thanks a lot for the replies!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.