Sunday, May 5, 2024
52
rated 0 times [  52] [ 0]  / answers: 1 / hits: 281528  / 2 Years ago, wed, december 15, 2021, 5:12:37

I need a command to list all open ports in my PC, and another command to close a port.



Any suggestions?



I need to close some applications' port.


More From » command-line

 Answers
0

netstat can be used to see the ports stat.


sudo netstat -lnp

To list all Listening ports Numbers with the Process responsible on each one. Terminate or kill the process to close port. (kill, pkill ...)


Without process termination, It is not possible! . See Manually closing a port from command line. Other way you may look for a firewall solution (as isolating that port from network)


[#27299] Friday, December 17, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nuehan

Total Points: 253
Total Questions: 109
Total Answers: 120

Location: Singapore
Member since Sat, Jul 25, 2020
4 Years ago
nuehan questions
Sun, Dec 18, 22, 17:34, 1 Year ago
Mon, Mar 28, 22, 00:10, 2 Years ago
Fri, Jun 24, 22, 11:39, 2 Years ago
Thu, Apr 28, 22, 20:54, 2 Years ago
Fri, Aug 20, 21, 01:06, 3 Years ago
;