List running processes in terminal, filter and kill them, if required

You can list all the run­ning processes in linux ter­mi­nal using the fol­low­ing command :

List run­ning process :

ps -aef

If you want more infor­ma­tion you can use the fol­low­ing command :

ps -aef | more

You can fil­ter par­tic­u­lar process as well. For exam­ple, if you can’t find out where does a node.js app run­ning, you can use the fol­low­ing command.

Fil­ter run­ning process :

ps -aef | grep 'node'

If you want to fil­ter a process run­ning on a par­tic­u­lar port you can use the fol­low­ing command :

ps -aef | grep 443

Once you find the process you can kill it using the fol­low­ing command :

Kill any run­ning processes :

kill -9 PID

replace the PID with process id which you find using grep.

You may also like...