博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
monitor disk
阅读量:7030 次
发布时间:2019-06-28

本文共 1132 字,大约阅读时间需要 3 分钟。

1 #!/bin/bash 2 # 3 #top 10 4 #Big_USERS - find big disk space users in various directories 5 ############################################################## 6 #Parameters for Script 7 # 8 CHECK_DIRECTORIES=" $HOME" #directories to check 9 #10 ##############################################################11 #12 ########### Main Script #####################################13 #14 DATE=$(date '+%m%d%y') #Date for report file15 #16 exec > disk_space_$DATE.rpt #Make report file Std Output17 #18 echo "Top Ten Disk Space Usage" #Report header for whole report19 echo "for $CHECK_DIRECTORIES Directories"20 #21 for DIR_CHECK in $CHECK_DIRECTORIES #loop to du directories22 do23 echo ""24 echo "The $DIR_CHECK Directories:" #title header for each directories25 #26 #Create a listing of top ten disk space users27 du -S $DIR_CHECK 2>/dev/null | #'S': make a total than 's'.28 sort -rn |    #rank with figure(n) and big is top(r).29 sed '{11,$D;=}' |30 sed 'N;s/\n/ /' |31 gawk '{printf $1 ":" "\t" $2 "\t" $3 "\n"}' #'\t' is table-make mark which equal a tab(there).32 #33 done34 #

 

转载于:https://www.cnblogs.com/little-snake/p/4555791.html

你可能感兴趣的文章
LeetCode--027--移除元素
查看>>
matlab练习程序(渲染三原色)
查看>>
slice splice substr substring
查看>>
NSIS检测操作系统x64还是x86的问题。
查看>>
Player 启动提示 Had errors initializing network: Can't Bind Socket
查看>>
poj - 1655 Balancing Act
查看>>
jQuery-淡入淡出效果-fadeIn()淡进 fadeOut()淡出 fadeToggle();
查看>>
C4D导出fbx文件到Unity中使用发现没有贴图
查看>>
java 文件、文件夹复制
查看>>
linux服务之memcached
查看>>
sed命令拷屏
查看>>
YCSB测试MongoDB分片
查看>>
TCP中的PPP
查看>>
SCCM2012系列之二,SCCM2012部署前的Active Directory准备
查看>>
统一沟通-技巧-11-Lync-联盟-1-MSN
查看>>
查询优化器内核剖析第二篇:产生候选执行计划&执行计划成本估算
查看>>
Forefront_TMG_2010-TMG发布SSL Web服务器
查看>>
Linux下Nagios的安装与配置
查看>>
Using Sqoop 1.4.6 With Hadoop 2.7.4
查看>>
jqGrid细节备注—jqGrid中获取subGrid的标题栏对象
查看>>