If you have a service running on your system on a certain port and you want to kill it using bash you can make use of the kill command, the kill command can send a signal to a process to terminate it,Example:
Say I have MySQL running on port 3306 or tomcat on 8080 and I want to kill it,
$ kill $(lsof -t -i:3306)
$ kill $(lsof -t -i:8080)
lsof: list open files
-t: to produce an output of lsof without headers with just the process identifier (PID)
Have Questions? Post them here!
- How to see Created Accessed Modified and Changed dates of a file using bash terminal command
- How to Kill a port using bash terminal command?
- 'pwd' is not recognized as an internal or external command, operable program or batch file. [Windows]
- bash get year 2021 calendar
- How to create new user account in Windows bash
- How to start or open a new bourne-again shell (bash) session on Windows using Command Line CMD
- How to check your IP using bash for Windows?
- reCAPTCHA Implementation Tutorial - CSS
- AADSTS90033: A transient error has occurred. Please try again. [Microsoft 365] - Microsoft
- Increase Android Emulator Timeout time - Android
- How to remove Floating Action Button Android Studio Blank Activity Template - Android-Studio
- Top 3 Awesome Text Editors developers prefer at workplace - Sublime