Skip to content

A Linux Tool that forcefully turn off PORTS on your PC.

License

Notifications You must be signed in to change notification settings

isaka-james/closeport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Close Port Tool

since 04 Sep,2024

A simple Bash script to identify processes using a specified port, retrieve their process IDs (PIDs), and terminate them. This script requires superuser (sudo) permissions to run.

Overview

The closeport.sh script is designed to help system administrators and users easily manage network ports by terminating any processes that are currently using a specified port.

Features

  • Takes a port number as an argument.
  • Identifies if any processes are using the specified port.
  • Retrieves the process IDs (PIDs) of these processes.
  • Terminates the processes using the specified port.
  • Provides feedback on whether any processes were found and terminated or if the port was unused.

Requirements

  • Bash shell
  • sudo privileges

Usage

  1. Clone the Repository

    git clone https://github.com/isaka-james/closeport.git
  2. Navigate to the Repository

    cd closeport
  3. Make the Script Executable

    chmod +x closeport.sh
  4. Run the Script

    sudo ./closeport.sh <port_number>

    Replace <port_number> with the port number you want to check and close. For example:

    sudo ./closeport.sh 8080

Example

If the script is run with port 8080 and there is a process using this port, you might see output like:

Process with PID 1234 is using port 8080 and has been terminated.

If no process is found using the specified port:

No process is using port 8080.

Nerd Installation

sudo chmod +x closeport.sh && sudo mv closeport closeport && sudo mv closeport /usr/bin && echo "Installed successfully!"

So now you can type sudo closeport 8080 to forcefully stop PORT 8080 in your MACHINE.

If you ever feel to uninstall it then type sudo rm -rf /usr/bin/closeport

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Isaka James

Releases

No releases published

Packages

No packages published

Languages