Shell monitoring disk usage "Go"

Source: Internet
Author: User
Tags disk usage

Programme one:

Disks= ('DF|sed1d |awk '{print $1,$5}'|TR-D%') Len=${#disks [@]} for((i=1; i<= $len; i=i+2)); Do    if[${disks[i]}-GT the]; Then        Echo "${disks[$i-1]} ${disks[$i]}"    fi Done

Scenario Two:

DF -th| awk ' [ |%]+ ' ' nr>1 {if ($6>80) print $} '

Programme III:

DF -tph| awk ' +$6>80 {print $} '

Note that the + number before $6, when using the arithmetic operator, the operand is automatically converted to a numeric value, as follows:

[Email protected] ~]#DF-tphfilesystem Type Size used Avail use%mounted on/dev/sda3 ext34.0G 790M3.0G +% /Tmpfs Tmpfs 12G012G0%/dev/SHM/DEV/SDA7 Ext4 878G1.2G 832G1% /data0/DEV/SDB1 ext4 459G 117G 319G -% /data1/DEV/SDB2 ext4 459G 196G 240G $% /data2/DEV/SDC1 ext4 917G 205G 666G -% /data3/DEV/SDD1 ext4 917G 203G 669G -% /data4/DEV/SDF1 ext4 917G 203G 668G -% /Data5/DEV/SDG1 ext4 917G 202G 670G -% /data6/DEV/SDH1 ext4 917G 623G 248G the% /Data7/dev/sda5 ext37.9G 203M7.3G3% /tmp/DEV/SDA1 ext3 12G6.9G4.4G +% /usr/dev/sda6 ext37.9G1.1G6.5G the% /Var[[email protected]~]#DF-tph|awk '{print $6}' Use% +%0%1% -% $% -% -% -% -% the%3% +% the%[[Email protected]~]#DF-tph|awk '{print +$6}'0 +01 - $ - - - - the3 + the

Turn from

Shell Monitoring Disk Usage | Don't know the real person
Http://peiqiang.net/2015/07/07/use-shell-script-monitor-disk-usage.html?utm_source=tuicool

Shell monitoring disk usage "Go"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.