Home  >  Article  >  Operation and Maintenance  >  What is the linux view port command?

What is the linux view port command?

藏色散人
藏色散人Original
2020-02-13 10:25:4810014browse

What is the linux view port command?

What is the Linux port command?

Linux view port command

The first one:

lsof -i:port number

Recommendation: "Linux Tutorial"

Second type:

netstat -nltp | grep port number

-a: Display all connections and listening ports of this machine

-n: In the form of network IP address, display the currently established effective connections and ports

-r: Display routing table information

-s: Display statistics by protocol

-v: Display currently valid connections

-t: Display all TCP protocol connections

-u : Display all UDP protocol connection status

-i: Display the status of the automatically configured port

-l: Only display the service network status with the connection status listening

-p: Display pid/program name

Several statuses of TCP connection

ESTABLISHED    已建立
CLOSED   已关闭
LISTENING  正在监听
FIN-WAIT-2   等待连接关闭
TIME-WAIT   等待足够时间,确保服务器正常关闭该连接

The above is the detailed content of What is the linux view port command?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn