Check whether the port is occupied by DOS Commands

Source: Internet
Author: User

Check whether the port is occupied by the DOS command netstat

1. In Windows, how does one view port 80 usage? Which process is occupied? How to terminate.
Here we mainly use the dostool in windows. Click "start" -- "run", enter "cmd", and click "OK" to enter the DOS window. Then run the following commands:
> Netstat-Aon | findstr "80"
PROTO local address foreign address State PID
========================================================== ======
TCP 0.0.0.0: 80 0.0.0.0: 0 listening 1688
Port 80 is occupied by a program with process number 1688.
> Tasklist | findstr" 1688"
Image name PID session name session # memory usage
========================================================== ======================================
Inetinfo.exe 1688 console 0 2,800 K
Obviously, inetinfooccupies 80 ports. inetinfo.exe is mainly used to support debugging of Microsoft Windows IIS network services. This program is very important to the normal operation of your system.
Of course, the inetinfo.exe process only occupies port 80, which is only the case on my machine. if you do not know what the process is for, do not blindly kill it, it is best to search Baidu or Google first; of course, if you know it well, and are sure you can terminate, continue with the following command.
> Taskkill, PID 1688, and F
Successful: processes with a PID of 1688 have been terminated.
Worker is the image name in the task manager. Select it and click "End Process)
> Tasklist | findstr" 1688"
Confirm whether the command is successfully terminated. If the command is successfully terminated, an empty value is returned.

2. How can I check port 80 usage in Linux? Which process is occupied? How to terminate

Check whether the port is occupied. The process occupies the port in two ways: 1. netstat-anl | grep "80"; 2. lsof-I: 80

Process Termination method: kill PID

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.