In Linux, you can view the port, Process status, and kill process.

Source: Internet
Author: User

In Linux, you can view the port, Process status, and kill process.

View Port:

Ps-aux | grep tomcat

Tomcat process with no port 8080 is found.

Run netstat-apn

View all processes and port usage. The following process list is found. The last column is PID/Program name.

Port 8080 is occupied by Java processes with a PID of 9658.

Run the following command: ps-aux | grep java, or run the command: ps-aux | grep pid.

You can clearly know which program occupies port 8080! Then determine whether to use the KILL command to KILL it!


Method 2: directly use netstat-anp | grep portno
That is, netstat-apn | grep 8080

 

View process:

1. The ps command is used to view the currently running process.
Grep is search
Example: ps-ef | grep java
Displays information about java CMD processes in all processes.
2. ps-aux | grep java
-Aux: Show All statuses
Ps
3. The kill command is used to terminate the process.
Example: kill-9 [PID]
-9 indicates that the process is forced to stop immediately.
You can use ps to view the process PID and kill to terminate the process.

Related Article

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.