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 ...
随机推荐
- 用变量a给出下面的定义
a)一个整型数(An integer)b) 一个指向整型数的指针(A pointer to an integer) c) 一个指向指针的的指针,它指向的指针是指向一个整型数(A pointer to ...
- OC加强-day03
#program mark - 0_18 分类的使用注意 [掌握] 1.分类的作用 作用:讲一个类分为多个模块,将相似功能的方法写在同一个模块中,方便我们后面代码的维护 "强调 1.分类中只 ...
- iOS开发——JS网页交互——javaScript
JS中调用OC #import "ViewController.h" @interface ViewController () <UIWebViewDelegate> ...
- java I/O技术
一.流的分类 Java的流类大部分都是由InputStream.OutputStream.Reader和Writer这四个抽象类派生出来的 (1)按数据流向 输入流(InputStream类和Read ...
- Java实战之01Struts2-05contextMAP、EL、OGNL
十五.contextMap 1.动作类的生命周期 明确:动作类是多例的,每次动作访问,动作类都会实例化.所以是线程安全的.与Struts1的区别是,struts1的动作类是单例的. 2.请求动作的数据 ...
- Microsoft Windows Installer 工具 Msiexec.exe 的命令行选项
摘自:http://support.microsoft.com/kb/314881/zh-cn 概要 本文列出了 Windows Installer 工具 Msiexec.exe 的命令行选项.Msi ...
- ASP.NET前端语法应用
字符拼接 <%# "abc" + Eval("列名").ToString() %> <%# Eval("列名"," ...
- 【PHP】解决html网页乱码问题
在自己制作一个网页时,时常会遇到网页乱码的问题. 其实导致网页乱码主要有几个原因,以下给出解决方法. 1.HTML的字符编码问题 该问题较常见,也是最明显和最容易解决的. 在网页<head> ...
- JQ封装切换滚动功能
/*---------控制滚动图片v1(作者:SFLYQ)-----------Options 配置对象,(用来配置控制元素的dom位置,初始化一些必要的对象或者方法)DoIni 初始化操作(初始化元 ...
- NPOI2.0
今天在使用NPOI2.0读取上传excel文件(excel2010)时,报了一个很奇怪的错误:无效的 URI: 未能分析主机名. 在网上查找了下找到的出错情况跟这个完全不着边际,没有办法只有自己去测试 ...