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 ...
随机推荐
- 自己写的demo---equals()跟==的区别
package equals; /*public class equals { //基本数据类型跟引用数据类型(复合数据类型), //在引用数据类型中equals方法被重写,一般用来比较内存地址 pu ...
- 4柱汉诺塔(zz)
多柱汉诺塔可以用Frame–Stewart算法来解决. The Frame–Stewart algorithm, giving a presumably optimal solution for fo ...
- Mysql 的一些异常解决
一.关于大文件存储 1.利用mysql存储大文件时,异常截图 在配置文件中加上如下一行 2.改完后重启mysql,但是又报如下错误: 解决方案: 我的mysql 是5.6版本,查到网上说要修改配置文件 ...
- 界面动态加载时报NullPointException
今天在做环境监测的模拟软件时,登陆页面报NullPointException 一般像我们初始化Button时,是Button btn=(Button)findViewById(R.id.button1 ...
- A题笔记(14)
Reverse Words in a String : http://oj.leetcode.com/problems/reverse-words-in-a-string/ 代码 : https:// ...
- C#2.0至4.0 的一些特性
罗列清单备查 一.C#2.0 1. Partial class 分部类 file1.cs using System; public partial class MyClass { public voi ...
- Linux网络应用编程之集线器(Packet Tracer仿真)
Packet Tracer入门 一,集线器概况 对接收到的信号进行再生整形放大,以扩大网络的传输距离,同时把所有节点集中在以它为中心的节点上. 工作于OSI(开放式系统互联参考模型)的最底层(物理层) ...
- VMware中Ubuntu忘记密码的解决办法
在VMware中安装了Ubuntu 11.04,经过了一个长假,再次登录的时候居然进不去了,一开始不知道怎样在虚拟机中进入到Grub启动界面,网上搜索了一番,按照以下步骤重新为用户设定了新密码. 重启 ...
- svn强制添加注释脚本
@echo off setlocal set SVN_BINDIR=C:/Program Files/VisualSVN Server/bin/ set REPOS=%1 set TXN=%2 rem ...
- 你需要了解的z-index世界
本文摘自:飘零雾雨的博客 z-index的重要性 在我看来,z-index 给了我们日常工作中以极大的帮助,我们用它来定义元素的层叠级别(stack level).受益于它,你能做Popup, Dro ...