All rights are reserved by Niteesh Kumar.. Theme images by Storman. Powered by Blogger.

Followers

Total Pageviews

Blog archive

Follow by Email

Translate

Monday, 2 November 2020

How to check whether port number is already in use or not?



How to check whether port number is in use or not?

Sometimes we get the "PORT xxxx is already in use" error when trying to run an application. We also face this issue sometimes when while trying to access the any particular PORT number.

To check whether any particular port number is in use or not follow the  steps given below - 

  • Open "Terminal"
  • Type Below Command in Terminal window -     


     netstat -vanp tcp | grep 3000 // Replace 3000 with PORT Number


  • Replace 3000 with your PORT Number 
  • Click "Enter" and you will see the results in the screen.

Now if you want to make this port idle or available to use you just need to find the "PID" that will be there in the result of above command. 

After finding the "PID" of the process using this port number run the below command - 

kill "pid_value"


After running this command if you will run the command to search the port number you will see empty result.


0 on: "How to check whether port number is already in use or not?"