[LINUX] How to find out which process is using the localhost port and stop it

Introduction

When developing locally, the port number you want to use may still contain the process you used when you developed it earlier. Describe the coping method in such a case.

approach

If you want to know the process running on localhost port 3000, use the following command.

Terminal


$ lsof -i :3000

com.docke 25316 takuya   41u \
IPv6 0xc293b929f41a59e9      0t0  TCP *:hbci (LISTEN)

As described above, the PID number of the process running on port 3000 can be grasped. Here, the PID number is 25316, so stop the process as follows.

Terminal


$ kill -9 25316

-9 seems to be a forced termination option.

that's all

Recommended Posts

How to find out which process is using the localhost port and stop it
How to divide and process a data frame using the groupby function
How to find out the number of CPUs without using the sar command
[Introduction to Python] How to stop the loop using break?
Find out how many each character is in the string.
How easy is it to synthesize a drug on the market?
How to get followers and followers from python using the Mastodon API
[Python] What is pip? Explain the command list and how to use it with actual examples
How to input a character string in Python and output it as it is or in the opposite direction.
Find out the name of the method that called it from the method that is python
Find it in the procession and edit it
How to use is and == in Python
[Circuit x Python] How to find the transfer function of a circuit using Lcapy
How to read a serial number file in a loop, process it, and graph it
Try to find the probability that it is a multiple of 3 and not a multiple of 5 when one is removed from a card with natural numbers 1 to 100 using Ruby and Python.
How to find the area of the Voronoi diagram
How to install Cascade detector and how to use it
How to find the correlation for categorical variables
I tried to find out how to streamline the work flow with Excel x Python ②
I tried to find out how to streamline the work flow with Excel x Python ④
I tried to find out how to streamline the work flow with Excel x Python ⑤
[For beginners] How to display maps and search boxes using the GoogleMap Javascript API
I tried to find out how to streamline the work flow with Excel x Python ①
How to confirm the Persival theorem using the Fourier transform (FFT) of matplotlib and scipy
I tried to find out how to streamline the work flow with Excel x Python ③
It is easy to execute SQL with Python and output the result in Excel
It is difficult to install a green screen, so I cut out only the face and superimposed it on the background image
How to know the port number of the xinetd service
How to use the grep command and frequent samples
How to use argparse and the difference between optparse
How to use Decorator in Django and how to make it
What is pip and how do you use it?
How to find out if there is an arbitrary value in "somewhere" of pandas DataFrame
A story that makes it easy to estimate the living area using Elasticsearch and Python
How to get the current weather data and display it on the GUI while updating it automatically
Gtk-ERROR **: 04: 28: 17.451: GTK + 2.x symbols detected. Using GTK + 2.x and GTK + 3 in the same process is not supported error
[Python] What is a tuple? Explains how to use without tuples and how to use it with examples.
How to find the cumulative sum / sum for each group using DataFrame in Spark [Python version]
How to insert a specific process at the start and end of spider with scrapy
[VLC] How to deal with the problem that it is not in the foreground during playback