netstat -tulnap
shows me what ports are in use. How to free up a port in Linux?
相关问题
- Is shmid returned by shmget() unique across proces
- IPAddress.[Try]Parse parses 192.168 to 192.0.0.168
- how to get running process information in java?
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
The
"netstat --programs"
command will give you the process information, assuming you're root. Then you will have to kill the "offending" process which may well start up again just to annoy you :-).What are you actually trying to achieve here? Solutions will vary based on the processes holding those ports.
As the others have said, you'll have to kill all processes that are listening on that port. The easiest way to do that would be to use the fuser(1) command. For example, to see all of the processes listening for http requests on port 80 (run as root or use sudo):
If you want to kill them, then just add the -k option.
sudo killall -9 "process name"
Shutting down the computer always kills the process for me.