Method 1:
If you want to use backtick not regular tick
Eg: kill $(sudo lsof -t -i:9000) //Kill process listnining to port 9000
sudo kill 'sudo lsof -t -i:port'
Eg: sudo kill 'sudo lsof -t -i:9000' //Kill process listnining to port 9000
Method 2:
Method 2:
Some times above method doesn't work then you can use $() for command interpolation
sudo kill $(sudo lsof -t -i:port)
Eg: kill $(sudo lsof -t -i:9000) //Kill process listnining to port 9000
No comments:
Post a Comment