zoukankan      html  css  js  c++  java
  • CentOS7.2 问题收集 查看文件大小 查看端口

    1.在vmware中使用nat模式安装centos7.2,没有ifconfig命令?

    yum upgrade
    
    yum install net-tools

    2.查看当前目录所有文件大小

    [root@localhost /]# du -sh *
    0    bin
    130M    boot
    20K    data

    单个文件或文件夹

    [root@localhost /]# du -sh boot
    130M    boot

    3.查看端口被哪些进程使用

    [root@localhost /]# netstat -tunlp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
    tcp        0      0 127.0.0.1:2379          0.0.0.0:*               LISTEN      1449/etcd           
    tcp        0      0 127.0.0.1:2380          0.0.0.0:*               LISTEN      1449/etcd           
    tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      1465/kube-apiserver 
    tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1028/sshd           
    tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1142/master         
    tcp6       0      0 :::6443                 :::*                    LISTEN      1465/kube-apiserver 
    tcp6       0      0 :::22                   :::*                    LISTEN      1028/sshd           
    tcp6       0      0 :::8088                 :::*                    LISTEN      8785/docker-proxy-c 
    tcp6       0      0 ::1:25                  :::*                    LISTEN      1142/master         
    udp        0      0 0.0.0.0:24525           0.0.0.0:*                           832/dhclient        
    udp        0      0 0.0.0.0:68              0.0.0.0:*                           832/dhclient        
    udp6       0      0 :::18459                :::*                                832/dhclient        

    命令中参数:

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

    筛选具体端口:

    [root@localhost /]# netstat -tunlp | grep 80
    tcp        0      0 127.0.0.1:2380          0.0.0.0:*               LISTEN      1449/etcd           
    tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      1465/kube-apiserver 
    tcp6       0      0 :::8088                 :::*                    LISTEN      8785/docker-proxy-c 
  • 相关阅读:
    bzoj 4610 Ceiling Functi
    uva 01350
    uva 12075
    uva 01393
    uva 11038
    CF 496E
    CF 496D
    poj 3167
    hdu 4622
    spoj 7258
  • 原文地址:https://www.cnblogs.com/hongdada/p/8902689.html
Copyright © 2011-2022 走看看