Current location - Quotes Website - Collection of slogans - What command can enter Linux terminal mode to view all ports (not the current port)?
What command can enter Linux terminal mode to view all ports (not the current port)?
Use netstat command in Linux system to see which ports are open. The method is as follows:

netstat? -anp The following are explanations of common parameters:

NETSTAT[-a][-b][-e][-n][-o][-p proto][-r][-s][-v]

[interval]

-a shows all connections and listening ports.

-b shows the executable components involved in creating each connection or listening port.

-e Displays Ethernet statistics. This option can be used in combination with the -s option.

-n Displays the address and port number as numbers.

-o Displays the owning process ID associated with each connection.

The p option is used to specify a subset of the default cases.