1. #!/bin/bash
  2.  
  3. #command usage description
  4. function usage()
  5. {
  6. echo -e "Usage:nt$0 DIR_NAME"
  7. exit
  8. }
  9.  
  10. # Check if user is root
  11. if [ $(id -u) != "0" ]; then
  12. echo "Error: You must be root to run this script, please use root to use it!!!"
  13. exit 1
  14. fi
  15.  
  16. #judge the argv
  17. if [ $# -ne 1 ]
  18. then
  19. echo "the usage of the command is ERROR!!!"
  20. usage
  21. fi
  22.  
  23. dir_name=$1
  24. i=0
  25.  
  26. if [ ! -d $dir_name ]
  27. then
  28. echo "the argv is not a direction!!!"
  29. usage
  30. else
  31. cd $dir_name
  32. echo "pwd: " `pwd`
  33. du -ahS | sort -nr |
  34. while read line
  35. do
  36. myline=`echo $line | awk '{print $2}'`
  37. if [ -f $myline ] && [ $i -lt 5 ]
  38. then
  39. echo $line
  40. let i++
  41. fi
  42. done
  43. fi
  44. #!/bin/bash
  45.  
  46. #command usage description
  47. function usage()
  48. {
  49. echo -e "Usage:nt$0 DIR_NAME"
  50. exit
  51. }
  52.  
  53. # Check if user is root
  54. if [ $(id -u) != "0" ]; then
  55. echo "Error: You must be root to run this script, please use root to use it!!!"
  56. exit 1
  57. fi
  58.  
  59. #judge the argv
  60. if [ $# -ne 1 ]
  61. then
  62. echo "the usage of the command is ERROR!!!"
  63. usage
  64. fi
  65.  
  66. dir_name=$1
  67. i=0
  68.  
  69. if [ ! -d $dir_name ]
  70. then
  71. echo "the argv is not a direction!!!"
  72. usage
  73. else
  74. cd $dir_name
  75. echo "pwd: " `pwd`
  76. du -ahS | sort -nr |
  77. while read line
  78. do
  79. myline=`echo $line | awk '{print $2}'`
  80. if [ -f $myline ] && [ $i -lt 5 ]
  81. then
  82. echo $line
  83. let i++
  84. fi
  85. done
  86. fi

find big file的更多相关文章

  1. 记一个mvn奇怪错误: Archive for required library: 'D:/mvn/repos/junit/junit/3.8.1/junit-3.8.1.jar' in project 'xxx' cannot be read or is not a valid ZIP file

    我的maven 项目有一个红色感叹号, 而且Problems 存在 errors : Description Resource Path Location Type Archive for requi ...

  2. HTML中上传与读取图片或文件(input file)----在路上(25)

    input file相关知识简例 在此介绍的input file相关知识为: 上传照片及文件,其中包括单次上传.批量上传.删除照片.增加照片.读取图片.对上传的图片或文件的判断,比如限制图片的张数.限 ...

  3. logstash file输入,无输出原因与解决办法

    1.现象 很多同学在用logstash input 为file的时候,经常会出现如下问题:配置文件无误,logstash有时一直停留在等待输入的界面 2.解释 logstash作为日志分析的管道,在实 ...

  4. input[tyle="file"]样式修改及上传文件名显示

    默认的上传样式我们总觉得不太好看,根据需求总想改成和上下结构统一的风格…… 实现方法和思路: 1.在input元素外加a超链接标签 2.给a标签设置按钮样式 3.设置input[type='file' ...

  5. .NET平台开源项目速览(16)C#写PDF文件类库PDF File Writer介绍

    1年前,我在文章:这些.NET开源项目你知道吗?.NET平台开源文档与报表处理组件集合(三)中(第9个项目),给大家推荐了一个开源免费的PDF读写组件 PDFSharp,PDFSharp我2年前就看过 ...

  6. [笔记]HAproxy reload config file with uninterrupt session

    HAProxy is a high performance load balancer. It is very light-weight, and free, making it a great op ...

  7. VSCode调试go语言出现:exec: "gcc": executable file not found in %PATH%

    1.问题描述 由于安装VS15 Preview 5,搞的系统由重新安装一次:在用vscdoe编译go语言时,出现以下问题: # odbcexec: "gcc": executabl ...

  8. input type='file'上传控件假样式

    采用bootstrap框架样式 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> &l ...

  9. FILE文件流的中fopen、fread、fseek、fclose的使用

    FILE文件流用于对文件的快速操作,主要的操作函数有fopen.fseek.fread.fclose,在对文件结构比较清楚时使用这几个函数会比较快捷的得到文件中具体位置的数据,提取对我们有用的信息,满 ...

  10. ILJMALL project过程中遇到Fragment嵌套问题:IllegalArgumentException: Binary XML file line #23: Duplicate id

    出现场景:当点击"分类"再返回"首页"时,发生error退出   BUG描述:Caused by: java.lang.IllegalArgumentExcep ...

随机推荐

  1. HDU 4294 A Famous Equation(DP)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4249 题目大意:给一个a+b=c的表达式,但是a.b.c中部分位的数字丢失,并用?代替,问有多少种方案 ...

  2. 【制作镜像】安装VMwareTool

    vmware tools是虚拟机VMware Workstation自带的一款工具,它的作用就是使用户可以从物理主机直接往虚拟机里面拖文件. 启动虚拟机,切换到xwindows 在VMware Wor ...

  3. win8.1企业版更新到win10解决方案

    最近想把自己的win8.1更新成win10,发现月底就要免费更新了,由于我的电脑是企业版,官方不提供企业版的免费升级,所以用电脑管家或者360老是提示不对.我就百度了在注册表里面改成了专业版的,接着继 ...

  4. .net闭包的应用

    这里体现出闭包的数据共享 , , , , , , , , , }; ; ; values.ToList().ForEach(s => result1 += s); values.ToList() ...

  5. Java并发编程二三事

    Java并发编程二三事 转自我的Github 近日重新翻了一下<Java Concurrency in Practice>故以此文记之. 我觉得Java的并发可以从下面三个点去理解: * ...

  6. PHP-Wamp集成包安装教程

    在Windows平台上搭建PHP的开发环境可以下载WAMP(Windows.Apache.MySQL.PHP的首字母缩写)集成化安装包.这样就不需要单独安装Apache.MySQL和PHP了. 这款软 ...

  7. jquery插件----文件上传uploadfile

    使用了一款jquery上传的插件,ajax上传,可以显示上传的进度,高可配性,简要记录. 插件地址http://hayageek.com/docs/jquery-upload-file.php git ...

  8. Android 自定义View实现单击和双击事件

    自定义View, 1. 自定义一个Runnable线程TouchEventCountThread ,  用来统计500ms内的点击次数 2. 在MyView中的 onTouchEvent 中调用 上面 ...

  9. word中几个好用的宏代码(立方米上标、关闭样式自动更新、删除无效样式、表格加粗边框、宋体引号)

    Sub 替换立方米() With Selection.Find .Text = "m3" .Replacement.Text = "mm3" .Forward ...

  10. 浅谈JavaScript词法分析步骤

    JavaScript代码运行前有一个类似编译的过程即词法分析,词法分析主要有三个步骤: 分析参数 再分析变量的声明 分析函数声明 具体步骤如下: 函数在运行的瞬间,生成一个活动对象(Active Ob ...