3

I'm doing a project for school and it involves running a java program which sometimes crashes. In order to kill the unresponsive program, I'll go to my dock, right click on the program and press "Force Quit":

Dock

The program it kills has a window with a title "Planet Wars Visualizer", and the top menu for the program in the top left says "CLViewer":

Window

Instead of having to press "Force Quit" every time, I want to just use the killall <name> command. However, when I go to my activity monitor I don't see any processes with the names "Java", "Planet Wars Visualizer", or "CLViewer". Even when I try killall with those names I just get No matching processes belonging to you were found.

How can I find out the actual name of the process just by the clues I have?

  • What do you get if you issue the command ps -a? – Allan Oct 28 '17 at 23:57
  • Here: imgur.com/a/tNBFy – MarksCode Oct 29 '17 at 0:00
  • Please paste the text into your answer. It's difficult to see on a mobile device. You can pipe the output directly to the clipboard with the command ps -a | pbcopy – Allan Oct 29 '17 at 1:40
1

When the program goes unresponsive, open Activity Monitor and see if a process is followed by a message in red which says unresponsive. You can get the name of the process from there.

1

Use the pkill command.

From the man page (man pkill)

The pkill command searches the process table on the running system and signals all processes that match the criteria given on the command line.

Before issuing the pkill command, it's useful to test it out by using the pgrep command first (from man page: "find or signal processes by name").

Once you are certain that pgrep is finding the processes you are interested in killing, issue the pkill command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .