zoukankan      html  css  js  c++  java
  • Linux显示系统信息sh脚本

    #!/bin/bash
    #
    #********************************************************************
    #Author:                wangxiaochun
    #QQ:                    29308620
    #Date:                  2020-04-01
    #FileName:             system_info.sh
    #URL:                   http://www.magedu.com
    #Description:          The test script
    #Copyright (C):         2020 All rights reserved
    #********************************************************************
    RED="E[1;31m"
    GREEN="E[1;32m"
    END="E[0m"
    echo -e "$GREEN----------------------Host systeminfo--------------------$END"
    echo -e  "HOSTNAME:     $RED`hostname`$END"
    echo -e  "IPADDR:       $RED` ifconfig eth0|grep -Eo '([0-9]{1,3}.){3}[0-9]{1,3}' |head -n1`$END"
    echo -e  "OSVERSION:    $RED`cat /etc/redhat-release`$END"
    echo -e  "KERNEL:       $RED`uname -r`$END"
    echo -e  "CPU:         $RED`lscpu|grep 'Model name'|tr -s ' '|cut -d : -f2`$END"
    echo -e  "MEMORY:       $RED`free -h|grep Mem|tr -s ' ' : |cut -d : -f2`$END"
    echo -e  "DISK:         $RED`lsblk |grep '^sd' |tr -s ' ' |cut -d " " -f4`$END"
    echo -e "$GREEN---------------------------------------------------------$END"
    #!/bin/bash
    #
    #********************************************************************
    #Author:                wangxiaochun
    #QQ:                    29308620
    #Date:                  2020-04-01
    #FileName:             system_info.sh
    #URL:                   http://www.magedu.com
    #Description:          The test script
    #Copyright (C):         2020 All rights reserved
    #********************************************************************
    RED="E[1;31m"
    GREEN="E[1;32m"
    END="E[0m"
    echo -e "$GREEN----------------------Host systeminfo--------------------$END"
    echo -e  "HOSTNAME:     $RED`hostname`$END"
    echo -e  "IPADDR:       $RED` ifconfig eth0|grep -Eo '([0-9]{1,3}.){3}[0-9]{1,3}' |head -n1`$END"
    echo -e  "OSVERSION:    $RED`cat /etc/redhat-release`$END"
    echo -e  "KERNEL:       $RED`uname -r`$END"
    echo -e  "CPU:         $RED`lscpu|grep 'Model name'|tr -s ' '|cut -d : -f2`$END"
    echo -e  "MEMORY:       $RED`free -h|grep Mem|tr -s ' ' : |cut -d : -f2`$END"
    echo -e  "DISK:         $RED`lsblk |grep '^sd' |tr -s ' ' |cut -d " " -f4`$END"
    echo -e "$GREEN---------------------------------------------------------$END"
    
    curl -s www.wangxiaochun.com/testdir/system_info.sh | bash
    
    * * * 胖并快乐着的死肥宅 * * *
  • 相关阅读:
    spark rdd--分区理解
    2020-05-03 助教一周小结(第十二周)
    2020-04-26 助教一周小结(第十一周)
    2020-04-19 助教一周小结(第十周)
    2020-04-12 助教一周小结(第九周)
    2020-04-05 助教一周小结(第八周)
    2020-03-29 助教一周小结(第七周)
    2020-03-22 助教一周小结(第六周)
    内网渗透思考(实践)
    2020-03-15 助教一周小结(第五周)
  • 原文地址:https://www.cnblogs.com/bpzblog/p/12611682.html
Copyright © 2011-2022 走看看