Debian12查看端口占用情况

使用debian默认自带的命令查看端口占用情况

  • 使用ss命令
    ss为netstat的现代替代工具,功能更强,性能更好
#查看所有端口占用情况
ss -tulnp

#查询8080端口占用情况
ss -tulnp | grep ":8080"

参数解释:

  1. -t:显示TCP端口
  2. -u:显示UDP端口
  3. -l:仅显示处于监听状态的端口
  4. -n:以数字形式显现地址和端口
  • use lsof
    for example:
# Query the usage of port 80
lsof -i :80

# template
lsof -i <port>

you can see more detail in ss --help or lsof --help

posted @ 2025-04-11 18:50  lkhdaio  阅读(649)  评论(0)    收藏  举报