Linux golden commands

Written on 2019-09-23 16:33:48

Last updated 2019-11-06 09:11:00

Kill any process using port

USE THIS COMMAND ON YOUR OWN RISK !

sudo kill -9 $(sudo lsof -t -i:4200)

If you want to check that if process running than and than kill the process , use bellow one

if sudo lsof -t -i:4200; then sudo kill -9 $(sudo lsof -t -i:4200); fi

Above command will check that process is running than kill by process id.

Kill any process by it's process name

her I am killing htop process using bellow command.

sudo pkill htop 

sh: 1: cross-env: Permission denied npm ERR! code ELIFECYCLE

sudo chown -R $USER /usr/local

chmod -R a+x node_modules

blog comments powered by Disqus