Kill process in shell
1. Check for Zombie Processes
Use the ps command to check for zombie processes.
ps aux | grep 'Z'
2. Check Port Usage
Use lsof or netstat to check if the port is still being used and by which process
sudo lsof -i :60001
This is show all of 60001 ports processes, you can check the PID in there.
3. Kill process by PID
kill [PID]
kill -9 [PID]
This means force to stop process
4. Check the current process again
The problem I met is my computer always had two processes, one from Java, one from sudo. So I need to kill the sudo, because cooja run in Java.