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
Linux显示系统信息sh脚本的更多相关文章
- Linux中运行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory。
在Linux中运行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...
- 在Linux中执行.sh脚本,异常
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...
- 在Linux中执行.sh脚本,异常/bin/sh^M
在Linux中执行.sh脚本,异常/bin/sh^M 在linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分 ...
- Linux定时执行.sh脚本
因为测试ffmpeg推流用flv方式的话没有做自动断流,所以要先用.sh脚本来执行关流,降低CPU和其他资源占用 首先编写.sh文件 #! /bin/bash echo "kill ffmp ...
- linux下执行sh脚本,提示Command not found解决办法
1.确保用户对文件有读写及执行权限 oracle@linux-106:~/RMAN/bin> chmod a+x test.sh 2.然后修改文件格式(如果是从winodws搬过来的会显示dos ...
- linux系统软件启动sh脚本
在系统维护中,编写脚本会帮助运维提高效率,现记录一个通用的软件启动脚本.脚本内容如下: #!/bin/bash # 软件启动程序包名称 APP_NAME=datadog-4.2.0.jar # 软件名 ...
- linux第一个C语言和sh脚本
linux第一个C语言 $ gedit hello_world.c #include <stdio.h> int main(void) { printf("hello world ...
- linux sh脚本异常:/bin/sh^M:bad interpreter: No such file or directory
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory.这是不同系统编码格式引起的:在windows系统中编辑的. ...
- sh脚本异常:/bin/sh^M:bad interpreter: No such file or directory
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...
随机推荐
- js动画之轮播图
一. 使用Css3动画实现 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
- shell变量操作${}详细用法
${}基本功能 一般情况下$var与${var}是没有区别的,但是用${ }会比较精确的界定变量名称的范围 [root@localhost ~]# A=Linux [root@localhost ~] ...
- k8s service对象
k8s service对象 概述 service服务也是Kubernetes里核心字眼对象之一,Kubernetes里的每一个service其实就是我们经常提起的微服务架构中的一个微服务,之前讲解 ...
- k8s重要概念及部署k8s集群(一)
k8s介绍 Kubernetes(k8s)是Google开源的容器集群管理系统(谷歌内部:Borg).在Docker技术的基础上,为容器化的应用提供部署运行.资源调度.服务发现和动态伸缩等一系列完整功 ...
- turtle空间坐标系
利用空间坐标改变行进 以海龟的角度来看,无论往那个方向运行,都叫正方向 turtle.fd向海龟的正前方运行,turtle.bk向反方向运行
- Redis—HyperLogLog
HyperLogLog 实现一个功能 统计网站的UV (user view),区别PV (page view) 数据去重 统计总数 同一个用户的反复点击进入记为 1 次 解决方案 最简单的思路是记录集 ...
- 关于Apache报错 couldn't perform authentication. AuthType not set!
今天在使用apache搭建yum的web服务时,配置完成后.访问http://ip 时,浏览器报错:500 Internal Server Error 然后查询error.log发现,有如下错误提示: ...
- Spring学习(九)Spring 和数据库编程【了解】
一.传统 JDBC 回顾 用一个大佬的demo来简单看一下 /** * 使用jdbc,根据id查询单个Student的信息 */ public class JdbcManage { public St ...
- spring in action-note-2
1.AOP:在软件业,AOP为Aspect Oriented Programming的缩写,意为:面向切面编程,通过预编译方式和运行期动态代理实现程序功能的统一维护的一种技术.AOP是OOP的延续,是 ...
- chrome禁止三方cookie,网站登录不了怎么办
背景 新版chrome(80+)浏览器默认屏蔽所有三方cookie已经不是什么新闻了,具体原因这里不去深究,有大量相关文章介绍,由于目前许多网站都依赖三方cookie,因此该特性的推出还是造成了一些的 ...