zoukankan      html  css  js  c++  java
  • 每天写点shell脚本 (持续更新)

    1、显示系统信息脚本

    #!/bin/bash
    #A system information gathering script
    #Command 1
    UNAME="uname -a"
    printf "Gathering system information with the $UNAME command:
    
    "
    $UNAME
    
    #Command 2
    DISKSPACE="df -h"
    printf "Gathering diskspace information with the $DISKSPACE command: 
    
    "
    $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
  • 相关阅读:
    括号匹配
    超级阶梯问题
    进制问题
    rwkj 1423
    next_permutation
    rwkj 1420
    uva-10392-因数分解
    uva-10305-水题-拓扑排序
    uva-10194-排序
    uva-10152-乌龟排序
  • 原文地址:https://www.cnblogs.com/wangtao1993/p/6501354.html
Copyright © 2011-2022 走看看