Have you ever experienced exiting out of an application and you can’t come back to it because the port is already in use. For example doing an iperf and accidentally pressing ctrl+C for some reason which takes you back to the command prompt.
Issuing the iperf -s command would give you an error message saying port is already in use.
Solution is to release the port with the use of lsof.
type: lsof -n -i
This will list down all your active ports and once you’ve found the port you’re after. Kill it with fuser so the format would be:
fuser -k /
Check the screenshot below.