1、显示系统信息脚本

#!/bin/bash
#A system information gathering script
#Command
UNAME="uname -a"
printf "Gathering system information with the $UNAME command:\n\n"
$UNAME #Command
DISKSPACE="df -h"
printf "Gathering diskspace information with the $DISKSPACE command: \n\n"
$DISKSPACE
~

以上实例运行结果:

$ sh test4.sh
Gathering system information with the uname -a command: Linux gio016 2.6.-431.29..lustre.el6.x86_64 # SMP Fri Jul :: CST x86_64 x86_64 x86_64 GNU/Linux
Gathering diskspace information with the df -h command: Filesystem Size Used Avail Use% Mounted on
/dev/sda3 258G 100G 146G % /
tmpfs 32G 32G % /dev/shm
/dev/sda1 485M 142M 318M % /boot
/dev/memdiska .1T 132G 914G % /home/export/tmp
17.0.1.3@o2ib:17.0.1.4@o2ib:/gswgfs
.3P 988T .2P % /home/export/online1
10.0.0.206:/vol/vol_user_home
.8T .3G .8T % /home/export/base

每天写点shell脚本 (持续更新)的更多相关文章

  1. 写个shell脚本

    以前更新网站程序都是手动噼里啪啦敲代码,即麻烦又慢,还神经紧张.终于忍不住写个shell脚本.   cd /usr/local/tomcat7/apache-tomcat-9.0.0.M4/ bin/ ...

  2. 好记性不如烂笔头--linux学习笔记9练手写个shell脚本

    #!/bin/bash #auto make install httpd #by authors baker95935 #httpd define path variable H_FILES=http ...

  3. 写好shell脚本的13个技巧【转】

    有多少次,你运行./script.sh,然后输出一些东西,但却不知道它刚刚都做了些什么.这是一种很糟糕的脚本用户体验.我将在这篇文章中介绍如何写出具有良好开发者体验的 shell 脚本. 产品的最终用 ...

  4. 写一个shell脚本利用wget抓取股票历史数据

    今天,大数据部老大交给我一项任务——抓取股票历史数据.于是乎,我自行在网上找了一下,发现wget真真是一个非常强大的linux下载工具.我已经被深深震撼到了.下面叙述今天的一些过程,还是比较坎坷的. ...

  5. syntax error near unexpected token `do(写的shell脚本出现格式问题)--->1.问题2.展示信息3.解决方案

    1问题:Linux和windows下的回车换行符不兼容的问题 [root@node-01 script]# sh start_zk.sh art_zk.sh: line 3: syntax error ...

  6. 写个shell脚本搭载jenkins让你的程序部署飞起来

    [转载请注明]: 原文出处:https://www.cnblogs.com/jstarseven/p/11399251.html    作者:jstarseven    码字挺辛苦的.....  说明 ...

  7. shell脚本持续更改

    1.用shell查看磁盘是否大于80%并发送邮箱告警. 分析如何查看磁盘占用: # df -h | grep /dev/vda1 | awk '{print $5}' |cut -d "%& ...

  8. 写了shell脚本想一键启动三台虚拟机的Zookeeper,却不知道为啥总是启动不了

    首先,一键启动的shell脚本是这样的 #! /bin/bash case $1 in "start"){ for i in node01 node02 node03 do ssh ...

  9. 在linux写一个shell脚本用maven git自动更新代码并且打包部署

    服务器上必须安装了git maven jdk 并且配置好环境变量 实际服务器中可能运行着多个Java进程,所以重新部署的时候需要先停止原来的java进程,写一个按照名称杀死进程的脚本 kill.sh ...

随机推荐

  1. Bootstrap 3之美07-插件Collapse、Accordion、Modal、Tab、Tooltip、Alert、Carousel

    类似Page Header, Breadcrumbs, Dropdowns等,都是Bootstrap的组件,是静态的.如果涉及到交互,Bootstrap提供了插件.这些插件包括: ○ 过渡效果: bo ...

  2. 想要快速上手 Spring Boot?看这些教程就足够了!| 码云周刊第 81 期

    原文:https://blog.gitee.com/2018/08/19/weekly-81/ 想要快速上手 Spring Boot?看这些教程就足够了!| 码云周刊第 81 期 码云周刊 | 201 ...

  3. cocos2d-x 安卓环境配置 -转

    win7+cocos2d-x-2.1.4+vs2012环境太简单就不多说了,下面是eclipse环境 一.准备 1.eclipse+adt+sdk:adt-bundle-windows-x86_64- ...

  4. python笔记28-lxml.etree爬取html内容

    前言 本篇继续lxml.etree学习,在线访问接口,通过接口返回的html,解析出想要的text文本内容 环境准备: python 3.6 lxml requets 定位目标 爬取我的博客首页htt ...

  5. pytest文档19-doctest测试框架

    前言 doctest从字面意思上看,那就是文档测试.doctest是python里面自带的一个模块,它实际上是单元测试的一种. 官方解释:doctest 模块会搜索那些看起来像交互式会话的 Pytho ...

  6. 【BZOJ】【1089】【SCOI2003】严格n元树

    高精度/递推 Orz Hzwer…… 然而我想多了…… 理解以后感觉黄学长的递推好精妙啊 顺便学到了一份高精度的板子= =233 引用下题解: f[i]=f[i-1]^n+1 ans=f[d]-f[d ...

  7. 血淋淋的事实告诉你:你为什么不应该在JS文件中保存敏感信息

    在JavaScript文件中存储敏感数据,不仅是一种错误的实践方式,而且还是一种非常危险的行为,长期以来大家都知道这一点. 而原因也非常简单,我们可以假设你为你的用户动态生成了一个包含API密钥的Ja ...

  8. 基于zabbix 的memached 多实例监控

    基于zabbix 的memached 多实例监控 zabbix agentd 配置文件新增配置: UserParameter=memcached.server.discovery[*],ps uax ...

  9. 使用route add添加路由,使两个网卡同时访问内外网

    route add命令格式:route [-f] [-p] [Command] [Destination] [mask Netmask] [Gateway] [metric Metric] [if I ...

  10. Median of Two Sorted Array leetcode java

    题目: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sor ...