If you want to use a certain port to run some application on your Unix/Linux based system such as macOS but you get "Address/Port already in use" error and you don't have access to stop the service then you can kill this process as follows,
- Open Terminal.
- Run the command with the port used : example : lsof -i : <port_number>.
- You will get an output with ProcessID - PID if some process is running on it..
- Now kill the process by running the following command : kill -9 <PID> (example : kill -9 4133)..
- Now try to run the server you would not get BindException exception..
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 4133 code2care 13u IPv6 0x335aaef2sdf 0t0 TCP *:a39c892 (LISTEN)

Know all services running on ports macOS
To know which services are running on which port you can do a port scan on a Mac device as follows:
- Open Network Utility (using Spotlight Search)
- Go to Post Scan tab
- If the services are running on localhost Enter IP as localhost or 127.0.0.1
- You can run the test for all ports or certain range say 80 to 10000
Port Scan has started…
Port Scanning host: 127.0.0.1
Open TCP Port: 80 http
Open TCP Port: 88 kerberos
Open TCP Port: 443 https
Open TCP Port: 631 ipp
Open TCP Port: 3306 mysql
Port Scan has completed…
More Posts related to HowTos,
- How to create a New Project in Visual Studio Code (VS Code)
- How to Whitelist IP Address on GoDaddy Hosting?
- CentOS Cannot find a valid baseurl for repo base7x86_64 yum
- Fix: This app is no longer shared with you error iPhone or iPad iOS
- How to check the version of NodeJS installed
- [Error] There was an error connecting to the apple id server
- Find Restroom Near Me - Closest Toilet Nearby Using Your Current Location
- How to install xz data compression software using Brew
- Steps to Delete or Deactivate Instagram Account
- How to enable line numbers in IntelliJ
- How to display line numbers in Terminal while displaying content of a file
- Unzip a Zip file from Terminal Command
- Install SonarLint on Visual Studio Code
- How to Scan iPhone for Virus? Is Antivirus it really required?
- 100+ SEO Tips to improve your website search ranking
- [fix] Editor could not be opened unexpected error: File is a directory (VS Code)
- How to Fix Spelling Errors on Microsoft Word for Mac
- How to convert byte array to String [Kotlin]
- [Fix] Error 1020 Cloudflare: Access was denied
- Command: How to scp a file to remote server location?
- What is an Authorization Code Grant? OAuth 2.0
- How to Connect to AWS Windows EC2 UI Instance from M1 Mac (Updated 2022)
- How to replace with space
- VS Code Remove Unused Imports Keyboard Shortcut
- How to rerun last command in Zsh shell
More Posts:
- Install Bash on Alpine Linux - Docker - Docker
- Remove Html head and body tags from ckeditor source - Html
- Installing JD Decompiler plugin in Eclipse IDE - Eclipse
- How to stop disable Facebook video autoplay during scroll - Facebook
- WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. - PIP
- Programmatically check if Facebook is installed on Android device - Android
- How to create MD5 digest in Notepad++ - NotepadPlusPlus
- [Java] Read a File with UTF-8 Encoding - Java