Tips on writing shell scripts on mac
To make a shell script executable run chmod 755 myscript.sh
or chmod +x myscript.sh
in terminal.
To make a shell script executable run chmod 755 myscript.sh
or chmod +x myscript.sh
in terminal.
Use below command in terminal to get a list of all open ports:
netstat -an | grep LISTEN
Find the process ID (PID) of the port you wish to close. You may need to use sudo.
lsof -i :[portNumber]
Then use the following command to kill the process listening on your port. You may need to use sudo with kill -9 parameter.
kill [PID]