CentOS system view specified port status and kill

Source: Internet
Author: User
Tags centos


The results of the query find the process for the grep containing a specific string by pipeline. Pipe character "|" Used to separate two commands, the output of the command on the left side of the pipe will be the input to the right command of the pipe character

For example, view the status of Port 8083:

[Root@server1 ~]# NETSTAT-APN | grep 8083

TCP 0 0 192.168.2.17:8083 0.0.0.0:* LISTEN 3877/java

[Root@server1 ~]# kill-9 3877

Add: Pgrep:

What do you think first when you see Pgrep? Yes, grep!. Pgrep's p indicates that this command is dedicated to grep for process queries.

$ pgrep Firefox

1827

What did you see? Yes, Firefox's PID, and then you're typing:
$kill-S 9 1827

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.