首页 > 系统服务 > 详细

每天写点shell脚本 (持续更新)

时间:2017-03-04 15:27:23      阅读:270      评论:0      收藏:0      [点我收藏+]

1、显示系统信息脚本

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

#Command 2
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.32-431.29.2.lustre.el6.x86_64 #1 SMP Fri Jul 31 09:39:58 CST 2015 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  41% /
tmpfs                  32G     0   32G   0% /dev/shm
/dev/sda1             485M  142M  318M  31% /boot
/dev/memdiska         1.1T  132G  914G  13% /home/export/tmp
17.0.1.3@o2ib:17.0.1.4@o2ib:/gswgfs
                      3.3P  988T  2.2P  32% /home/export/online1
10.0.0.206:/vol/vol_user_home
                      2.8T  6.3G  2.8T   1% /home/export/base

 

每天写点shell脚本 (持续更新)

原文:http://www.cnblogs.com/wangtao1993/p/6501354.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!