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 ...
随机推荐
- Excel操作之 导出生成多个sheet页面
首先需要下载一个NPOI.dll 下载地址:http://download.csdn.net/detail/president810/9503038 using System; using Syste ...
- ios Object Encoding and Decoding with NSSecureCoding Protocol
Object Encoding and Decoding with NSSecureCoding Protocol February 27, 2014 MISC NSCoding is a fanta ...
- 如何诊断oracle数据库运行缓慢或hang住的问题
为了诊断oracle运行缓慢的问题首先要决定收集哪些论断信息,可以采取下面的诊断方法:1.数据库运行缓慢这个问题是常见还是在特定时间出现如果数据库运行缓慢是一个常见的问题那么可以在问题出现的时候收集这 ...
- 使用CLK.AspNet.Identity提供以角色为基础的访问控制(RBAC)
使用CLK.AspNet.Identity提供以角色为基础的访问控制(RBAC) 程序代码下载 程序代码下载:点此下载 前言 ASP.NET Identity是微软所贡献的开源项目,用来提供ASP.N ...
- c++学习笔记2(c++简单程序)
c++的简单程序 练习一: #include <iostream>int main(){std::cout<<"你好c++\n";int x;std::ci ...
- Linux的关机与重启命令
Linux的关机与重启命令 作者: Aillo, 发布于2009-05-10, 在系统分类下, 1条留言. 重启命令:1.reboot2.shutdown -r now 立刻重启(root用户使用)3 ...
- mysql主从 1050错误
在mysql从库上查询时出现如下错误 ...................... Last_Errno: 1050 Last_Error: Error 'Tab ...
- PDO操作mysql数据库(二)
从 MySQL 数据库读取数据 <?php $server = "localhost"; $user = "root"; $pwd = "123 ...
- php分页笔记
在做留言板的时候,用到了分页,所以写了这个分页笔记 既然已经开始写分页了,肯定掌握了了php的一些知识以及mysql的基本操作 在做分页的时候,我也遇到了很多问题,但是大家不要怕,无论什么问题 ...
- 用Eclipse 开发Dynamic Web Project应用程序 【转】
简介:本文仅简单介绍基于Eclipse开发Dynamic Web Project应用下的JSP,Servlet及TOMCAT数据源的配置和开发. 软件环境: Eclipse Java EE IDE f ...