find big file
#!/bin/bash #command usage description
function usage()
{
echo -e "Usage:nt$0 DIR_NAME"
exit
} # Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use root to use it!!!"
exit 1
fi #judge the argv
if [ $# -ne 1 ]
then
echo "the usage of the command is ERROR!!!"
usage
fi dir_name=$1
i=0 if [ ! -d $dir_name ]
then
echo "the argv is not a direction!!!"
usage
else
cd $dir_name
echo "pwd: " `pwd`
du -ahS | sort -nr |
while read line
do
myline=`echo $line | awk '{print $2}'`
if [ -f $myline ] && [ $i -lt 5 ]
then
echo $line
let i++
fi
done
fi
#!/bin/bash #command usage description
function usage()
{
echo -e "Usage:nt$0 DIR_NAME"
exit
} # Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use root to use it!!!"
exit 1
fi #judge the argv
if [ $# -ne 1 ]
then
echo "the usage of the command is ERROR!!!"
usage
fi dir_name=$1
i=0 if [ ! -d $dir_name ]
then
echo "the argv is not a direction!!!"
usage
else
cd $dir_name
echo "pwd: " `pwd`
du -ahS | sort -nr |
while read line
do
myline=`echo $line | awk '{print $2}'`
if [ -f $myline ] && [ $i -lt 5 ]
then
echo $line
let i++
fi
done
fi
find big file的更多相关文章
- 记一个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 ...
- HTML中上传与读取图片或文件(input file)----在路上(25)
input file相关知识简例 在此介绍的input file相关知识为: 上传照片及文件,其中包括单次上传.批量上传.删除照片.增加照片.读取图片.对上传的图片或文件的判断,比如限制图片的张数.限 ...
- logstash file输入,无输出原因与解决办法
1.现象 很多同学在用logstash input 为file的时候,经常会出现如下问题:配置文件无误,logstash有时一直停留在等待输入的界面 2.解释 logstash作为日志分析的管道,在实 ...
- input[tyle="file"]样式修改及上传文件名显示
默认的上传样式我们总觉得不太好看,根据需求总想改成和上下结构统一的风格…… 实现方法和思路: 1.在input元素外加a超链接标签 2.给a标签设置按钮样式 3.设置input[type='file' ...
- .NET平台开源项目速览(16)C#写PDF文件类库PDF File Writer介绍
1年前,我在文章:这些.NET开源项目你知道吗?.NET平台开源文档与报表处理组件集合(三)中(第9个项目),给大家推荐了一个开源免费的PDF读写组件 PDFSharp,PDFSharp我2年前就看过 ...
- [笔记]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 ...
- VSCode调试go语言出现:exec: "gcc": executable file not found in %PATH%
1.问题描述 由于安装VS15 Preview 5,搞的系统由重新安装一次:在用vscdoe编译go语言时,出现以下问题: # odbcexec: "gcc": executabl ...
- input type='file'上传控件假样式
采用bootstrap框架样式 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> &l ...
- FILE文件流的中fopen、fread、fseek、fclose的使用
FILE文件流用于对文件的快速操作,主要的操作函数有fopen.fseek.fread.fclose,在对文件结构比较清楚时使用这几个函数会比较快捷的得到文件中具体位置的数据,提取对我们有用的信息,满 ...
- ILJMALL project过程中遇到Fragment嵌套问题:IllegalArgumentException: Binary XML file line #23: Duplicate id
出现场景:当点击"分类"再返回"首页"时,发生error退出 BUG描述:Caused by: java.lang.IllegalArgumentExcep ...
随机推荐
- Ajax.Utility.RegisterTypeForAjax(typeof(_Default)) 的使用
语句的作用:页面注册方法的作用. Ajax.Utility.RegisterTypeForAjax(typeof(命名空间.类名)); 首先要在配置文件里配置 <httpHandlers> ...
- A题笔记(13)
Evaluate Reverse Polish Notation Reverse Words in a String 类似的,需要将原序列后序排列的时候,都可以用 栈 来实现 stack<int ...
- leetcode处女作
闲来无事[真的吗?你确定→_→ 在leetcode上刷了一道题.费时一小时,也是醉了.谨以此文,纪念我的伟大成果.[呵呵 题目是找出非排序数组中缺少的最小正整数.要求时间复杂度O(n),空间复杂度为常 ...
- uiscrollview上的 uipangesturerecognizer冲突
最近在tableview里的cell imageview加了个 uipangesturerecognizer发现优先滚动imageview,往上拖的时候,tableView不响应滚动了,原来是tabl ...
- javascript在html中使用 第10节
javascript在html中使用 index.html: <html> <head> <title>javascript</title> <s ...
- ilasm.exe与ildasm.exe的使用(编译与反编译)
ilasm.exe与ildasm.exe的使用(编译与反编译) 首先打开cmd命令.cd 到 C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0 ...
- foreach的一点理解
首先什么样的数据才能实现foreach 1 实现IEnumerable这个接口 2 有GetEnumerable()这个方法 然后为啥实现这个接口或者有这个方法就可以实现foreach遍历 首先我先用 ...
- leetcode problem 31 -- Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permuta ...
- Javascript执行环境、作用域链
执行环境 可以把执行环境想象为一个圆圈,里面包含了一些变量.函数. 执行环境定义了变量或函数的有权访问的其他数据,决定了它们各自的行为.还有一个顶部执行环境.在浏览器中,顶部执行环境既为window, ...
- js点击 密码输入框密码显示隐藏
很多密码框都有个眼睛标记,点击能显示密码.原理就是点击切换password为text等显示 下面上代码 <!DOCTYPE html> <html> <head> ...