zoukankan      html  css  js  c++  java
  • linux之在当前目录下按照文件大小进行排序的三种方法

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

    [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 ' | 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

  • 相关阅读:
    进程对象的属性或方法详解
    进程理论以及开启子进程的两种方式
    计算机发展史(多道技术)
    基于socketserver实现的并发(tcp和udp)
    基于udp协议的套接字及udp协议粘包问题
    模拟ssh的远程网络传输
    周考题目及答案
    c/s架构搭建
    网络编程基础
    10.16模拟赛(湖南集训)
  • 原文地址:https://www.cnblogs.com/FengGeBlog/p/10415743.html
Copyright © 2011-2022 走看看