1 / 4
文档名称:

shell stat命令.docx

格式:docx   页数:4页
下载后只包含 1 个 DOCX 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

shell stat命令.docx

上传人:luyinyzha 2014/11/22 文件大小:0 KB

下载得到文件列表

shell stat命令.docx

文档介绍

文档介绍:shell stat命令
  1. netstat命令
    可查询当前主机所有开启的网络服务端口。
    [******@linux ~]# netstat -tuln
    Active connections (only servers)
    Proto Recv-Q Send-Q Local Address Foreign Address State
    tcp 0 0 :2049 :* LISTEN
    tcp 0 0 :43975 :* LISTEN
    tcp 0 0 :51886 :* LISTEN
    tcp 0 0 :45903 :* LISTEN
    tcp 0 0 :111 :* LISTEN
    tcp 0 0 :22 :* LISTEN
    tcp 0 0 :631 :* LISTEN
    tcp 0 0 :::80 :::* LISTEN
    tcp 0 0 :::22 :::* LISTEN
    tcp 0 0 ::25 :::* LISTEN
    udp 0 0 :68 :*
    udp 0 0 :69 :*
    udp 0 0 :111 :*
    udp 0 0 :137 :*
    说明:
    -t---------------->tcp
    -u--------------->udp
    -l---------------->listening
    -n--------------->numberic
    80--------------->www
    22--------------->ssh
    21---------------->ftp
    25---------------->mail
    ex:
    stat来侦测主机是否开启了四个网络服务端口
    [******@linux ~]# vim
    #!/bin/bash
    PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
    export PATH
    echo "Now, the services of your Linux system will be detect!"
    echo -e "The www, ftp, ssh, and mail will be detect! \n"
    testing='netstat -tuln | grep ":80"'
    if [ "$testing" != "" ]; then
    echo " in your system"
    fi
    testing=