Linux

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

Source: http://tips.tutorialhorizon.com/2015/10/19/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.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s