Files
tldr/pages.zh/common/netstat.md

33 lines
655 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# netstat
> 显示与网络相关的信息,例如打开的连接、打开的套接字端口等。
> 另见:`ss`。
> 更多信息:<https://manned.org/netstat>。
- 列出所有端口:
`netstat --all`
- 列出所有监听端口:
`netstat --listening`
- 列出监听的TCP端口
`netstat --tcp`
- 显示PID和程序名称
`netstat --program`
- 持续列出信息:
`netstat --continuous`
- 列出路由并不将IP地址解析为主机名
`netstat --route --numeric`
- 列出监听的TCP和UDP端口如果你是root用户还包括用户和进程
`netstat --listening --program --numeric --tcp --udp --extend`