每天写点shell脚本 (持续更新)
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脚本 (持续更新)的更多相关文章
- 写个shell脚本
以前更新网站程序都是手动噼里啪啦敲代码,即麻烦又慢,还神经紧张.终于忍不住写个shell脚本. cd /usr/local/tomcat7/apache-tomcat-9.0.0.M4/ bin/ ...
- 好记性不如烂笔头--linux学习笔记9练手写个shell脚本
#!/bin/bash #auto make install httpd #by authors baker95935 #httpd define path variable H_FILES=http ...
- 写好shell脚本的13个技巧【转】
有多少次,你运行./script.sh,然后输出一些东西,但却不知道它刚刚都做了些什么.这是一种很糟糕的脚本用户体验.我将在这篇文章中介绍如何写出具有良好开发者体验的 shell 脚本. 产品的最终用 ...
- 写一个shell脚本利用wget抓取股票历史数据
今天,大数据部老大交给我一项任务——抓取股票历史数据.于是乎,我自行在网上找了一下,发现wget真真是一个非常强大的linux下载工具.我已经被深深震撼到了.下面叙述今天的一些过程,还是比较坎坷的. ...
- 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 ...
- 写个shell脚本搭载jenkins让你的程序部署飞起来
[转载请注明]: 原文出处:https://www.cnblogs.com/jstarseven/p/11399251.html 作者:jstarseven 码字挺辛苦的..... 说明 ...
- shell脚本持续更改
1.用shell查看磁盘是否大于80%并发送邮箱告警. 分析如何查看磁盘占用: # df -h | grep /dev/vda1 | awk '{print $5}' |cut -d "%& ...
- 写了shell脚本想一键启动三台虚拟机的Zookeeper,却不知道为啥总是启动不了
首先,一键启动的shell脚本是这样的 #! /bin/bash case $1 in "start"){ for i in node01 node02 node03 do ssh ...
- 在linux写一个shell脚本用maven git自动更新代码并且打包部署
服务器上必须安装了git maven jdk 并且配置好环境变量 实际服务器中可能运行着多个Java进程,所以重新部署的时候需要先停止原来的java进程,写一个按照名称杀死进程的脚本 kill.sh ...
随机推荐
- Ransac 与 最小二乘(LS, Least Squares)拟合直线的效果比较
代码下载地址 http://pan.baidu.com/s/1eQIzj3c 进入目录后,请自行定位到该博客的源代码与数据的目录“
- Windows 7 卸载 IE10
今天微软为Windows 7发布了IE10预览版,你是否已经安装?根据笔者的体验,IE10确实如微软所说,在速度.性能等各方面都有了明显提升. 不过,IE10发布预览版安装后会直接替代IE9,如果你想 ...
- go语言 defer 高级
go语言defer语句的用法 defer的语法 defer后面必须是函数调用语句,不能是其他语句,否则编译器会出错. package main import "log" func ...
- Eclipse点不出方法了
window→preferences→java→editor→Content Assist→Advanced 然后选中右上方的所有 右下方选中一个即可.
- Ladda 应用提交表单的时候显示loading载入中 包含不同位置,不同效果
Ladda 应用提交表单的时候显示loading载入中 包含不同位置,不同效果 不同大小.位置,效果,进度条等 演示 XML/HTML Code <article class="exa ...
- mac下virtualbox安装win7系统
下载安装参考: http://win.bai-bang.top/shendu64win7.html 1.之前在win7下的virtualbox安装win7操作溜溜的,换做mac,不知道是不是太久没有安 ...
- python文章学习列表
1.https://home.cnblogs.com/u/darkpig/feed/blog/ 这篇博主的系列文章 2.
- acd Convex(求面积)
Problem Description We have a special convex that all points have the same distance to origin point. ...
- HTML5 Canvas,WebGL,CSS Shaders,GLSL的暧昧关系 【转】
HTML5 Canvas,WebGL,CSS Shaders,GLSL的暧昧关系 这篇文章发布于 2011年10月10日,星期一,17:14,归类于 canvas相关. 阅读 58013 次, 今日 ...
- JSP简单练习-定时刷新页面
<%@ page contentType="text/html; charset=gb2312" %> <%@ page import="java.ut ...