I want to extract the process id of a certain process in order to shut it down. The process is a local web server using a certain port (localhost:3000), and I am currently doing it like this to extract the relevant line:
lsof|grep localhost:3000
but the lsof command is too slow. Is there a faster way to extract the process id?
lsof -ilist just the network connections. – Hanan N. Nov 30 '11 at 10:44lsofis not the slow part, using all the name resolutions and ip resolving is. Make it all numeric and it will go fast. – Marcin Nov 30 '11 at 14:29killallpgreporpkill? – Nils Dec 1 '11 at 20:28