Linux-netstat

  • This article is the study notes; compared to the original may be some comments and modifications
  • Please indicate the source

See all ports occupancy, and found details of the software's port occupied in the process, and finally the end of the process

  • Check port usage, the last column is the PID/Program name
    use of command: netstat
    the COMMAND:

    netstat –apn
  • See more details about the software port occupancy
    using the command: ps, grep
    the COMMAND:

    ps -aux | grep java
    或者直接:
    ps -aux | grep pid
  • Terminate the occupation of the port of the software process
    using the command: kill
    COMMANDS:

    kill -9 [pid]
    也可以直接使用如下指令:
    netstat -anp | grep portno
  • Use netstatthe command to view occupancy

    netstat -ap |grep 8080 //查找tomcat端口是否被占用
  • other

    netstat -tln //表示以数字形式查看正在监听的端口
    netstat -ap //查看所有应用占用端口情况

netstat

netstat [Options]
-aor--all Show all connections in the Socket
-A<网络类型>or--<网络类型> The network connection types are listed in the relevant address
-cor--continuous Maintains a list of network status
-Cor--cache Show cached information router configuration
-eor--extend Other relevant information display network
-For--fib Display the FIB
-gor--groups Multi-function display broadcast group members list
-hor--help Online Help
-ior--interfaces Display network interface information form
-lor--listening The display monitor server Socket
-Mor--masquerade Cloaked network connection
-nor--numeric Ip address directly, without passing through the domain name server
-NOr --netlinkor--symbolic Symbolic names are shown connected to network hardware peripheral devices
-oor--timers Display Timer
-por--programs Display program identifier and the program name being used Socket
-ror--route Display Routing Table
-sor--statistice Statistics show networking information
-tor--tcp Display the connection status of TCP transport protocol
-uor--udp Show connection status UDP transport protocol
-vor--verbose Display during execution of instructions
-Vor--version Displays version information
-wor--raw Display the connection status of RAW Transfer Protocol
-xor--unix And the effect of this parameter specifies the same "-A unix" parameter
--ipor--inet And the effect of this parameter specifies the same "-A inet" parameter

Guess you like

Origin www.cnblogs.com/apimhnkj/p/11685947.html