前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >《快学BigData》--Linux netstart命令详解(13)

《快学BigData》--Linux netstart命令详解(13)

作者头像
小徐
发布2023-03-06 21:11:36
1.9K0
发布2023-03-06 21:11:36
举报
文章被收录于专栏:GreenplumGreenplum

Linux netstart命令详解

1-1)、参数详解

-r, --route 显示路由表

-i, --interfaces display interface table

-g, --groups display multicast group memberships

-s, --statistics display networking statistics (like SNMP)

-M, --masquerade display masqueraded connections

-v, --verbose 显示详细信息

-W, --wide don't truncate IP addresses

-n, --numeric 不解析名称

--numeric-hosts 不解析主机名

--numeric-ports 忽略端口名称

--numeric-users 忽略用户名

-N, --symbolic resolve hardware names

-e, --extend 显示更多信息

-p, --programs display PID/Program name for sockets

-o, --timers display timers

-c, --continuous continuous listing

-l, --listening display listening server sockets

-a, --all display all sockets (default: connected)

-F, --fib display Forwarding Information Base (default)

-C, --cache display routing cache instead of FIB

-Z, --context display SELinux security context for sockets

1-2)、查看所有的打开的端口

$ netstat -a|head -n 5

Proto Recv-Q Send-Q Local Address Foreign Address State

tcp 0 0 localhost:mysql 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:hostmon 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN

*************

1-3)、列出所有tcp端口

$ netstat -at|head

Proto Recv-Q Send-Q Local Address Foreign Address State

tcp 0 0 localhost:mysql 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:hostmon 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN

tcp 0 0 localhost:ipp 0.0.0.0:* LISTEN

*************

1-4)、列出所有udp的端口

$ netstat -au|head

Proto Recv-Q Send-Q Local Address Foreign Address State

udp 0 0 0.0.0.0:46997 0.0.0.0:*

udp 0 0 localhost:domain 0.0.0.0:*

udp 0 0 0.0.0.0:bootpc 0.0.0.0:*

***********************

1-5)、列出所有的监听端口

$ netstat -l|head

Proto Recv-Q Send-Q Local Address Foreign Address State

tcp 0 0 localhost:mysql 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:hostmon 0.0.0.0:* LISTEN

tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN

tcp 0 0 localhost:ipp 0.0.0.0:* LISTEN

tcp6 0 0 [::]:hostmon [::]:* LISTEN

1-6)、常用带参数命令

netstat -lt : 列出所有netstat -lt 列出所有监听 tcp 端口

$netstat -lu 列出所有监听 udp 端口

$netstat -lx 列出所有监听 UNIX 端口

$netstat -s 显示所有端口

$netstat -st 显示TCP的端口

$netstat -su 显示UDP的端口

1-7)、按照端口查找程序相关的信息

$ sudo netstat -nltp|grep 22

tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1312/sshd

tcp6 0 0 :::22 :::* LISTEN 1312/sshd

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-01-31,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 河马coding 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Linux netstart命令详解
    • 1-1)、参数详解
      • 1-2)、查看所有的打开的端口
        • 1-3)、列出所有tcp端口
          • 1-4)、列出所有udp的端口
            • 1-5)、列出所有的监听端口
              • 1-6)、常用带参数命令
                • 1-7)、按照端口查找程序相关的信息
                相关产品与服务
                云数据库 SQL Server
                腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
                领券
                问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档