zoukankan      html  css  js  c++  java
  • linux查看端口占用

    方式一:

    [root@localhost /]# lsof -i:22
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    sshd 1219 root 3u IPv4 23508 0t0 TCP *:ssh (LISTEN)
    sshd 1219 root 4u IPv6 23519 0t0 TCP *:ssh (LISTEN)

    方式二:

    [root@localhost /]# netstat -tunlp | grep 22
    tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 1961/dnsmasq
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1219/sshd
    tcp6 0 0 :::22 :::* LISTEN 1219/sshd
    udp 0 0 192.168.122.1:53 0.0.0.0:* 1961/dnsmasq

    参数:

              -t (tcp) 仅显示tcp相关选项
                                     -u (udp)仅显示udp相关选项
                                     -n 拒绝显示别名,能显示数字的全部转化为数字
                                     -l 仅列出在Listen(监听)的服务状态
                                     -p 显示建立相关链接的程序名

    方式三:

    [root@localhost /]# ss -lntpd | grep 22
    tcp LISTEN 0 5 192.168.122.1:53 *:* users:(("dnsmasq",pid=1961,fd=6))
    tcp LISTEN 0 128 *:22 *:* users:(("sshd",pid=1219,fd=3))
    tcp LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=1219,fd=4))

    杂念太多,必然根基浅薄
  • 相关阅读:
    ulimit c unlimited
    2021.9.28 Sqoop
    2021.9.30 利用sqoop将hive数据导出到mysql
    2021.10.2 建造者模式
    111每日博客
    1029每日博客
    112每日博客
    113每日博客
    Panda 交易所视点观察!区块链金融应用迎新规,哪些版块受影响?
    c# 读取word
  • 原文地址:https://www.cnblogs.com/starshine-zhp/p/13227990.html
Copyright © 2011-2022 走看看