The killport is a command line tool used to terminate processes that are running on a specific network port. This is especially useful when you need to free up a port that is being occupied by a process, and can't manually identify and kill the process using traditional methods.
Install killport
Download the tar.gz
file from releases page of the killport repository:
wget -qO killport.tar.gz https://github.com/jkfran/killport/releases/latest/download/killport-x86_64-linux-gnu.tar.gz
Extract executable file to /usr/local/bin
directory:
sudo tar xf killport.tar.gz -C /usr/local/bin
We can check killport version as follows:
killport --version
Remove tar.gz
file:
rm -rf killport.tar.gz
Testing killport
The --dry-run
option lets you preview which processes would be terminated. For example, this command shows what would be killed on port 80:
sudo killport --dry-run 80
After reviewing, you can run this command to kill the processes listening on the specified port:
sudo killport 80
Uninstall killport
If killport is no longer needed, remove the executable file:
sudo rm -rf /usr/local/bin/killport
Leave a Comment
Cancel reply