# stop.sh ```bash= #!/bin/bash touch temp.text lsof -n -i4TCP:$1 | awk '{print $2}' > temp.text pidToStop=`(sed '2q;d' temp.text)` > temp.text if [[ -n $pidToStop ]] then kill -9 $pidToStop echo "Congrates!! $1 is stopped." else echo "Sorry nothing running on above port" fi rm temp.text ``` copy the above script ```bash= cd /usr/local/bin pbpaste|stop chmod +x stop ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up