当前目录下按照文件大小排序

[root@test23 script]# ls -lSh

总用量 44K

-rw-r--r-- 1 root root 2.4K 12月 8 17:24 test.conf

-rw-r--r-- 1 root root 1.3K 11月 30 16:05 count_pig.sh

-rw-r--r-- 1 root root 1.3K 12月 21 20:31 count_pig.sh.bak

-rw-r--r-- 1 root root 1.2K 1月 24 15:18 get_holiday.sh

-rw-r--r-- 1 root root 853 12月 6 12:23 two_points.sh

-rw-r--r-- 1 root root 817 1月 24 14:55 holiday.txt

-rw-r--r-- 1 root root 458 1月 25 19:52 create_passwd.sh

-rw-r--r-- 1 root root 134 12月 18 16:44 all.sh

-rw-r--r-- 1 root root 119 12月 18 16:56 99.sh

-rw-r--r-- 1 root root 96 12月 8 15:02 test.php

-rw-r--r-- 1 root root 38 12月 1 10:44 test.sh

-rw-r--r-- 1 root root 0 1月 24 00:00 tempfile

1) ls

[root@test23 script]# ls -Sh

test.conf count_pig.sh.bak two_points.sh create_passwd.sh 99.sh test.sh

count_pig.sh get_holiday.sh holiday.txt all.sh test.php tempfile

2) find

[root@test23 script]# find ./ -type f -printf '%s %p\n' | sort -rn

2443 ./test.conf

1318 ./count_pig.sh.bak

1318 ./count_pig.sh

1180 ./get_holiday.sh

853 ./two_points.sh

817 ./holiday.txt

458 ./create_passwd.sh

134 ./all.sh

119 ./99.sh

96 ./test.php

38 ./test.sh

0 ./tempfile

3) du

[root@test23 script]# du -b * | sort -nr

2443 test.conf

1318 count_pig.sh.bak

1318 count_pig.sh

1180 get_holiday.sh

853 two_points.sh

817 holiday.txt

458 create_passwd.sh

134 all.sh

119 99.sh

96 test.php

38 test.sh

0 tempfile

linux之在当前目录下按照文件大小进行排序的三种方法的更多相关文章

  1. 详解linux下批量替换文件内容的三种方法(perl,sed,shell)

    在建设本网站的时候,发现新建了很多的网页,突然发现,每个文件都需要进行修改一样的内容,一个一个打开很是麻烦,所以,总结了一下如何快速修改一个目录下多个文件进行内容替换.第三种方法用的不多 方法一 使用 ...

  2. windows系统中,在当前目录下打开cmd命令行的两种方法

    1.在当前路径地址栏中直接输入‘cmd’,然后回车. 2.在当前路径下,按住‘shift’键同时点击鼠标右键,点击“在此处打开Powershell”. 其实你会发现,两个命令行有很大的区别. cmd: ...

  3. linux下修改.bash_profile立即生效的三种方法

    1 . .bash_profile 2 source .bash_profile 3 exec bash --login

  4. 虚拟机下CentOS 配置IP地址的三种方法

    1.自动获取IP地址(我不是用的这种方法,不做过多介绍) 虚拟机使用桥接模式,相当于连接到物理机的网络里,物理机网络有DHCP服务器自动分配IP地址. #dhclient 自动获取ip地址命令 #if ...

  5. hadoop搭建杂记:Linux下JDK环境变量的设置(三种配置环境变量的方法)

    Linux下JDK环境变量的设置(三种配置环境变量的方法) Linux下JDK环境变量的设置(三种配置环境变量的方法) ①修改/etc/profile文件 如果你的计算机仅仅作为开发使用时推荐使用这种 ...

  6. Linux系统下修改环境变量PATH路径的三种方法

    这里介绍Linux的知识,比如把/etc/apache/bin目录添加到PATH中有三种方法,看完之后你将学会Linux系统下如何修改环境变量PATH路径,需要的朋友可以参考下 电脑中必不可少的就是操 ...

  7. Linux下查看alert日志文件的两种方法

    --linux下查看alert日志文件的两种方法: --方法1: SQL> show parameter background_dump_dest; NAME TYPE VALUE ------ ...

  8. Linux下查看磁盘挂载的三种方法

    Linux下查看磁盘挂载的三种方法 2009-06-05 23:17 好久没有更新日志了,呵呵.不是没有要写的东东.实在抽不出时间来写,要准备公司的考试呢,C++考试.已经有七个月没有写C++代码了, ...

  9. Linux下查看压缩文件内容的 10 种方法

    Linux下查看压缩文件内容的 10 种方法 通常来说,我们查看归档或压缩文件的内容,需要先进行解压缩,然后再查看,比较麻烦.今天给大家介绍 10 不同方法,能够让你轻松地在未解压缩的情况下查看归档或 ...

随机推荐

  1. Kotlin 最佳实践

    为什么写此文 Kotlin很烦,Gralde很烦,还都是升级狂,加一块更烦.几个月不接触Kotlin,再次上手时便一片迷茫.所以记录此文,以便再次上手时查阅. 使用Gradle创建Kotlin项目 m ...

  2. 进程间通信IPC-管道

    管道是UNIX系统IPC的最古老的形式,所有的UNIX系统都提供此通讯机制.管道有以下两种局限性: 1, 历史上,它们是半双工的(即数据只能在一个方向上流动).现在某些系统提供了全双工管道,但是为了最 ...

  3. php中的heredoc和nowdoc对比

    两者的不同就相当于php双引号和单引号的不同,双引号会解析里边的变量,而单引号不会 heredoc语法 <?php $a = 'cqh'; $str = <<<HTML hel ...

  4. 使用shell脚本来自动化处理我们的工作,解放双手

    Shell脚本介绍 1.Shell脚本,就是利用Shell的命令解释的功能,对一个纯文本的文件进行解析,然后执行这些功能,也可以说Shell脚本就是一系列命令的集合. 2.Shell可以直接使用在wi ...

  5. POJ 3268 Silver Cow Party(Dijkstra算法求解来回最短路问题)

    题目链接: https://vjudge.net/problem/POJ-3268 One cow from each of N farms (1 ≤ N ≤ 1000) conveniently n ...

  6. SpringMVC4返回json

    前言 目前前后端分离后,接口大多数返回给前端的都是json数据,那么我尝试用SpringMVC4的Controller返回json.demo过程中遇到了几个问题写出来和java初学者分享一下. 开发环 ...

  7. [转载] C# 调用C++ DLL 的类型转换

    //C#调用C++的DLL搜集整理的所有数据类型转换方式,可能会有重复或者多种方案,自己多测试 //c++:HANDLE(void *) ---- c#:System.IntPtr //c++:Byt ...

  8. Nullable<System.DateTime>日期格式转换 (转载)

    一.问题 1.html页面中时间显示出错,数据库中时间是正确的. 原因:没有把DateTime转成String类型. 2.  在C#中,发现不能直接使用ToString("yyyy-MM-d ...

  9. Perfect hashing (And Minimal perfect hashing)

    Perfect Hashing: A hash function that is injective-that is, maps each valid input to a different has ...

  10. RSA key format is not supported

    对接支付宝时,提示RSA错误 : 请仔细检查 : 创建支付对象时,关键字参数的名字 如果公私钥是以拼接路径的方式传递给AliPay,正确的关键字参数的名字应该如下 :