原帖地址:

Linux如何搜索大文件或目录总计

转自:

转自:

前些天刚好遭遇这样的难题,在新浪中来看有上述地点的一篇小说,照着方面包车型大巴操作解决了难题,可是排版上望着不是专门舒服,本身也想记录下来,就全文COPY了,只是改了下版式。望小编谅解

 

在Windows系统中,大家得以应用TreeSize工具找寻一些大文件或文件夹,分外的有益快速,在Linux系统中,怎么样去研究一些非常的大的文件呢?下面笔者收10了弹指间在Linux系统中怎样找寻大文件或文件夹的点子。

在Windows系统中,我们能够运用TreeSize工具找寻一些大文件或文件夹,非凡的惠及快速,在Linux系统中,怎样去查究一些极大的文本呢?下边笔者收十了一下在Linux系统中哪些寻觅大文件或文件夹的点子。

① 如何寻找大文件

事实上过多时候,你需求了然 /u01/app/oracle/oradata/prod/
下有哪些大的数据文件,举例文件大小当先100M或1G(阀值视具体意况而定)。那么哪些把那个大文件搜索出来啊?

 

 

 

Linux怎么着找出大文件或目录计算,LINUX下搜寻大文件及大的文书夹。一.一查找钦点目录下超越钦命大小的公文

比如笔者要探求 /u01/app/oracle/oradata/prod/ 下,超越500M轻重缓急的文本

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/  -type f -size +500M

/u01/app/oracle/oradata/prod/sysaux01.dbf

/u01/app/oracle/oradata/prod/system01.dbf

如上命令所示,大家唯有能收看当先500M高低的公文的文件名称,不过对文件的音讯(举例,文件大小、文件属性)一窍不通,那么是否更详细显示一些文件属性或新闻吗,当然能够

原帖地址: 
多谢潇湘隐者,感谢那多少个

壹:
如何搜索大文件?

一:
怎么着寻觅大文件?

壹.贰找出钦定目录下抢先钦点大小的文本(彰显文件用户、属组)

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/  -type f -size +500M  -print0 | xargs -0 ls –l

-rw-r----- 1 oracle oinstall 545267712 11-19 23:20 /u01/app/oracle/oradata/prod/sysaux01.dbf

-rw-r----- 1 oracle oinstall 744497152 11-19 23:20 /u01/app/oracle/oradata/prod/system01.dbf

 

实在过多时候,你供给掌握当下系统下有哪些大文件,比方文件大小抢先十0M或1G(阀值视具体景况而定)。那么怎么样把这么些大文件搜索出来吧?比如笔者要搜索当前目录下,超越800M大大小小的公文

实际上过多时候,你供给领悟当下系统下有哪些大文件,比如文件大小超越100M或1G(阀值视具体情形而定)。那么什么样把这一个大文件寻觅出来啊?比方作者要探寻当前目录下,超越800M尺寸的文件

1.3寻找钦赐目录下超过钦定大小的文书(展现文件详细size)

当大家只要求搜索抢先500M轻重文件,并突显查找寻来文件的切切实实尺寸,能够利用下边发号施令

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/ -type f -size +500M  -print0 | xargs -0 du –h

521M    /u01/app/oracle/oradata/prod/sysaux01.dbf

711M    /u01/app/oracle/oradata/prod/system01.dbf

 

[root@getlnx01 u03]# pwd

/u03

[root@getlnx01 u03]# find . -type f -size +800M

./flash_recovery_area/backup/backupsets/ora_df873519197_s46815_s1

./flash_recovery_area/backup/backupsets/ora_df873523646_s46822_s1

./flash_recovery_area/backup/backupsets/ora_df873521714_s46818_s1

./flash_recovery_area/backup/backupsets/ora_df873522876_s46820_s1

./flash_recovery_area/backup/backupsets/ora_df873517396_s46813_s1

./flash_recovery_area/backup/backupsets/ora_df873523321_s46821_s1

./flash_recovery_area/backup/backupsets/ora_df873515765_s46811_s1

./flash_recovery_area/backup/backupsets/ora_df873520789_s46817_s1

./flash_recovery_area/backup/backupsets/ora_df873524162_s46823_s1

./flash_recovery_area/backup/backupsets/ora_df873518302_s46814_s1

./flash_recovery_area/backup/backupsets/ora_df873519953_s46816_s1

./flash_recovery_area/backup/backupsets/ora_df873516500_s46812_s1

./flash_recovery_area/backup/backupsets/ora_df873513413_s46809_s1

./flash_recovery_area/backup/backupsets/ora_df873514789_s46810_s1

./oradata/epps/invsubmat_d08.dbf

./oradata/epps/gmtinv_d08.dbf

./oradata/epps/gmtinv_x01.dbf

./oradata/epps/undotbs02.dbf

./oradata/epps/gmtinv_d07.dbf

./oradata/epps/undotbs01.dbf

./oradata/epps/gmtinv_x02.dbf
[root@getlnx01 u03]# pwd

/u03

[root@getlnx01 u03]# find . -type f -size +800M

./flash_recovery_area/backup/backupsets/ora_df873519197_s46815_s1

./flash_recovery_area/backup/backupsets/ora_df873523646_s46822_s1

./flash_recovery_area/backup/backupsets/ora_df873521714_s46818_s1

./flash_recovery_area/backup/backupsets/ora_df873522876_s46820_s1

./flash_recovery_area/backup/backupsets/ora_df873517396_s46813_s1

./flash_recovery_area/backup/backupsets/ora_df873523321_s46821_s1

./flash_recovery_area/backup/backupsets/ora_df873515765_s46811_s1

./flash_recovery_area/backup/backupsets/ora_df873520789_s46817_s1

./flash_recovery_area/backup/backupsets/ora_df873524162_s46823_s1

./flash_recovery_area/backup/backupsets/ora_df873518302_s46814_s1

./flash_recovery_area/backup/backupsets/ora_df873519953_s46816_s1

./flash_recovery_area/backup/backupsets/ora_df873516500_s46812_s1

./flash_recovery_area/backup/backupsets/ora_df873513413_s46809_s1

./flash_recovery_area/backup/backupsets/ora_df873514789_s46810_s1

./oradata/epps/invsubmat_d08.dbf

./oradata/epps/gmtinv_d08.dbf

./oradata/epps/gmtinv_x01.dbf

./oradata/epps/undotbs02.dbf

./oradata/epps/gmtinv_d07.dbf

./oradata/epps/undotbs01.dbf

./oradata/epps/gmtinv_x02.dbf

1.4探索钦赐目录下超越钦命大小的文本(按大小排序,结果有出入)

澳门金沙国际 ,假设您还要求对搜索结果依据文件大小做1个排序,那么能够选择下边发号施令

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/  -type f -size +500M  -print0 | xargs -0 du -h | sort -nr

711M    /u01/app/oracle/oradata/prod/system01.dbf

521M    /u01/app/oracle/oradata/prod/sysaux01.dbf

在Linux系统中,怎么样去寻觅一些异常的大的公文呢?上边作者整理了一晃在Linux系统中哪些寻找大文件或文件夹的章程。

澳门金沙国际 1

澳门金沙国际 2

壹.5查找内定目录下当先指定大小的文书(按大小排序,严峻的)

而是如上截图所示,有时候排列的顺序并不完全是按大小同样,这一个是因为du命令的参数h所致,你能够统一使用应用MB来体现,这样就能一挥而就那几个主题材料

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/ -type f -size +500M -print0 | xargs -0 du -hm | sort –n

521     /u01/app/oracle/oradata/prod/sysaux01.dbf

711     /u01/app/oracle/oradata/prod/system01.dbf

 

 

 

1.6 寻找钦点目录下超过钦命大小的文本(详细展现文件的属主、属组、文件大小(M为单位))

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/  -type f -size +500M  -print0 | xargs -0 ls -lh  | sort -nr

rw-r----- 1 oracle oinstall 711M 11-20 09:06 /u01/app/oracle/oradata/prod/system01.dbf
-rw-r----- 1 oracle oinstall 521M 11-20 09:06 /u01/app/oracle/oradata/prod/sysaux01.dbf

1 何以寻觅大文件

其实过多时候,你必要领会 /u01/app/oracle/oradata/prod/
下有怎样大的数据文件,举例文件大小超越100M或1G(阀值视具体意况而定)。那么什么样把这个大文件寻找出来吗?

如上命令所示,我们唯有能收看超越800M轻重的文本的文件名称,可是对文件的音信(举个例子,文件大小、文件属性)一窍不通,那么是或不是更详尽突显一些文件属性或消息吗,当然可以,如下所示

如上命令所示,大家无非能看出超越800M轻重缓急的公文的文件名称,不过对文本的音信(举例,文件大小、文件属性)一无所知,那么是或不是更详尽突显一些文件属性或音信呢,当然能够,如下所示

② 怎么着查找Linux下的大目录

譬如有时候磁盘空间告警了,而你平日又疏于管理、监察和控制文件的升高,那么笔者急需飞快的摸底哪些目录变得极大,那么此时我们得以借助du命令来帮我们缓慢解决这些标题

一.一找出钦定目录下抢先钦赐大小的文书

举例作者要物色 /u01/app/oracle/oradata/prod/ 下,超越500M大大小小的文书

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/  -type f -size +500M

/u01/app/oracle/oradata/prod/sysaux01.dbf

/u01/app/oracle/oradata/prod/system01.dbf

 

如上命令所示,大家只是能收看超过500M高低的文本的文件名称,然则对文件的音讯(比如,文件大小、文件属性)一窍不通,那么是或不是更详尽呈现一些文件属性或新闻吗,当然可以

[root@getlnx01 u03]# find . -type f -size +800M  -print0 | xargs -0 ls -l

-rw-r----- 1 oracle oinstall 2782846976 Mar  6 11:51 ./flash_recovery_area/backup/backupsets/ora_df873513413_s46809_s1

-rw-r----- 1 oracle oinstall 1878433792 Mar  6 11:53 ./flash_recovery_area/backup/backupsets/ora_df873514789_s46810_s1

-rw-r----- 1 oracle oinstall 1378492416 Mar  6 11:54 ./flash_recovery_area/backup/backupsets/ora_df873515765_s46811_s1

-rw-r----- 1 oracle oinstall 1641381888 Mar  6 11:56 ./flash_recovery_area/backup/backupsets/ora_df873516500_s46812_s1

-rw-r----- 1 oracle oinstall 1564065792 Mar  6 11:58 ./flash_recovery_area/backup/backupsets/ora_df873517396_s46813_s1

-rw-r----- 1 oracle oinstall 1663492096 Mar  6 12:00 ./flash_recovery_area/backup/backupsets/ora_df873518302_s46814_s1

-rw-r----- 1 oracle oinstall 1368244224 Mar  6 12:02 ./flash_recovery_area/backup/backupsets/ora_df873519197_s46815_s1

-rw-r----- 1 oracle oinstall 1629069312 Mar  6 12:04 ./flash_recovery_area/backup/backupsets/ora_df873519953_s46816_s1

-rw-r----- 1 oracle oinstall 1629954048 Mar  6 12:06 ./flash_recovery_area/backup/backupsets/ora_df873520789_s46817_s1

-rw-r----- 1 oracle oinstall 1202192384 Mar  6 12:07 ./flash_recovery_area/backup/backupsets/ora_df873521714_s46818_s1

-rw-r----- 1 oracle oinstall 1189388288 Mar  6 12:10 ./flash_recovery_area/backup/backupsets/ora_df873522876_s46820_s1

-rw-r----- 1 oracle oinstall 1089257472 Mar  6 12:11 ./flash_recovery_area/backup/backupsets/ora_df873523321_s46821_s1

-rw-r----- 1 oracle oinstall 1097687040 Mar  6 12:12 ./flash_recovery_area/backup/backupsets/ora_df873523646_s46822_s1

-rw-r----- 1 oracle oinstall 1051009024 Mar  6 12:13 ./flash_recovery_area/backup/backupsets/ora_df873524162_s46823_s1

-rw-r----- 1 oracle oinstall 4294975488 Apr  3 15:07 ./oradata/epps/gmtinv_d07.dbf

-rw-r----- 1 oracle oinstall 4194312192 Apr  1 22:36 ./oradata/epps/gmtinv_d08.dbf

-rw-r----- 1 oracle oinstall 4294975488 Apr  3 15:54 ./oradata/epps/gmtinv_x01.dbf

-rw-r----- 1 oracle oinstall 4294975488 Apr  3 15:57 ./oradata/epps/gmtinv_x02.dbf

-rw-r----- 1 oracle oinstall 4294975488 Apr  1 22:35 ./oradata/epps/invsubmat_d08.dbf

-rw-r----- 1 oracle oinstall 8589942784 Apr  4 09:55 ./oradata/epps/undotbs01.dbf

-rw-r----- 1 oracle oinstall 8589942784 Apr  4 09:15 ./oradata/epps/undotbs02.dbf
[root@getlnx01 u03]# find . -type f -size +800M  -print0 | xargs -0 ls -l

-rw-r----- 1 oracle oinstall 2782846976 Mar  6 11:51 ./flash_recovery_area/backup/backupsets/ora_df873513413_s46809_s1

-rw-r----- 1 oracle oinstall 1878433792 Mar  6 11:53 ./flash_recovery_area/backup/backupsets/ora_df873514789_s46810_s1

-rw-r----- 1 oracle oinstall 1378492416 Mar  6 11:54 ./flash_recovery_area/backup/backupsets/ora_df873515765_s46811_s1

-rw-r----- 1 oracle oinstall 1641381888 Mar  6 11:56 ./flash_recovery_area/backup/backupsets/ora_df873516500_s46812_s1

-rw-r----- 1 oracle oinstall 1564065792 Mar  6 11:58 ./flash_recovery_area/backup/backupsets/ora_df873517396_s46813_s1

-rw-r----- 1 oracle oinstall 1663492096 Mar  6 12:00 ./flash_recovery_area/backup/backupsets/ora_df873518302_s46814_s1

-rw-r----- 1 oracle oinstall 1368244224 Mar  6 12:02 ./flash_recovery_area/backup/backupsets/ora_df873519197_s46815_s1

-rw-r----- 1 oracle oinstall 1629069312 Mar  6 12:04 ./flash_recovery_area/backup/backupsets/ora_df873519953_s46816_s1

-rw-r----- 1 oracle oinstall 1629954048 Mar  6 12:06 ./flash_recovery_area/backup/backupsets/ora_df873520789_s46817_s1

-rw-r----- 1 oracle oinstall 1202192384 Mar  6 12:07 ./flash_recovery_area/backup/backupsets/ora_df873521714_s46818_s1

-rw-r----- 1 oracle oinstall 1189388288 Mar  6 12:10 ./flash_recovery_area/backup/backupsets/ora_df873522876_s46820_s1

-rw-r----- 1 oracle oinstall 1089257472 Mar  6 12:11 ./flash_recovery_area/backup/backupsets/ora_df873523321_s46821_s1

-rw-r----- 1 oracle oinstall 1097687040 Mar  6 12:12 ./flash_recovery_area/backup/backupsets/ora_df873523646_s46822_s1

-rw-r----- 1 oracle oinstall 1051009024 Mar  6 12:13 ./flash_recovery_area/backup/backupsets/ora_df873524162_s46823_s1

-rw-r----- 1 oracle oinstall 4294975488 Apr  3 15:07 ./oradata/epps/gmtinv_d07.dbf

-rw-r----- 1 oracle oinstall 4194312192 Apr  1 22:36 ./oradata/epps/gmtinv_d08.dbf

-rw-r----- 1 oracle oinstall 4294975488 Apr  3 15:54 ./oradata/epps/gmtinv_x01.dbf

-rw-r----- 1 oracle oinstall 4294975488 Apr  3 15:57 ./oradata/epps/gmtinv_x02.dbf

-rw-r----- 1 oracle oinstall 4294975488 Apr  1 22:35 ./oradata/epps/invsubmat_d08.dbf

-rw-r----- 1 oracle oinstall 8589942784 Apr  4 09:55 ./oradata/epps/undotbs01.dbf

-rw-r----- 1 oracle oinstall 8589942784 Apr  4 09:15 ./oradata/epps/undotbs02.dbf

2.一招来钦点目录下的大目录

[oracle@Oracle11g ~]$ du -h /u01  --max-depth=1

5.7G    /u01/app

16K     /u01/lost+found

5.7G    /u01

[oracle@Oracle11g ~]$ du -h /u01  --max-depth=2

2.6M    /u01/app/oraInventory

5.7G    /u01/app/oracle

5.7G    /u01/app

16K     /u01/lost+found

5.7G    /u01

[oracle@Oracle11g ~]$ du -h /u01  --max-depth=3

16K     /u01/app/oraInventory/ContentsXML

8.0K    /u01/app/oraInventory/oui

2.6M    /u01/app/oraInventory/logs

2.6M    /u01/app/oraInventory

1.7G    /u01/app/oracle/oradata

4.0K    /u01/app/oracle/checkpoints

4.0G    /u01/app/oracle/product

716K    /u01/app/oracle/admin

232K    /u01/app/oracle/cfgtoollogs

6.8M    /u01/app/oracle/diag

5.7G    /u01/app/oracle

5.7G    /u01/app

16K     /u01/lost+found

5.7G    /u01

假定您想知道/u0一目录上边有啥样大文件夹,那么可以将参数max-depth=2,借使您想对寻觅出来的结果举办排序,那么能够借助sort命令。如下所示

[oracle@Oracle11g ~]$ du -h /u01  --max-depth=2 |sort -n

2.6M    /u01/app/oraInventory

5.7G    /u01

5.7G    /u01/app

5.7G    /u01/app/oracle

16K     /u01/lost+found

[oracle@Oracle11g ~]$ du -h /u01  --max-depth=3 |sort -n

1.7G    /u01/app/oracle/oradata

2.6M    /u01/app/oraInventory

2.6M    /u01/app/oraInventory/logs

4.0G    /u01/app/oracle/product

4.0K    /u01/app/oracle/checkpoints

5.7G    /u01

5.7G    /u01/app

5.7G    /u01/app/oracle

6.8M    /u01/app/oracle/diag

8.0K    /u01/app/oraInventory/oui

16K     /u01/app/oraInventory/ContentsXML

16K     /u01/lost+found

232K    /u01/app/oracle/cfgtoollogs

716K    /u01/app/oracle/admin

偶然找寻出来的结果太多了(譬如,作者从根目录发轫寻找),一贯在刷屏,假如本人只想获悉最大的多少个文件夹,如何是好呢?此时就要借助head命令来体现了

[oracle@Oracle11g ~]$ du -hm /u01/app/oracle/ --max-depth=2 | sort -nr | head -5

5741    /u01/app/oracle/

4057    /u01/app/oracle/product/11.2.0

4057    /u01/app/oracle/product

1677    /u01/app/oracle/oradata/prod

1677    /u01/app/oracle/oradata

一.二查找钦赐目录下超越钦点大小的公文(显示文件用户、属组)

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/  -type f -size +500M  -print0 | xargs -0 ls –l

 

-rw-r—– 1 oracle oinstall 545267712 11-19 23:20 /u01/app/oracle/oradata/prod/sysaux01.dbf

-rw-r—– 1 oracle oinstall 744497152 11-19 23:20 /u01/app/oracle/oradata/prod/system01.dbf

 

澳门金沙国际 3

澳门金沙国际 4

叁.要好收10的(实用的)

一.③寻找钦赐目录下抢先内定大小的文书(显示文件详细size)

 

当大家只供给寻找当先500M高低文件,并展示查搜索来文件的现实大小,能够利用上边发号施令

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/ -type f -size +500M  -print0 | xargs -0 du –h

 

521M    /u01/app/oracle/oradata/prod/sysaux01.dbf

711M    /u01/app/oracle/oradata/prod/system01.dbf

 

当大家只需求搜求超过800M轻重文件,并展现查找寻来文件的切切实实大小,能够选取下边发号施令

当大家只要求探究超过800M分寸文件,并出示查找寻来文件的求实尺寸,能够运用上面发号施令

三.一 查找系统中的大目录(从大到小排序,取前多少个)

[root@Oracle11g ~]# du -hm / --max-depth=1 | sort -nr | head -5

9456    /
5744    /u01
2964    /usr
260     /dev
234     /lib

1.四物色钦定目录下超过钦定大小的文件(按大小排序,结果有出入)

假若您还亟需对找出结果根据文件大小做三个排序,那么能够应用上边发号施令

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/  -type f -size +500M  -print0 | xargs -0 du -h | sort -nr

711M    /u01/app/oracle/oradata/prod/system01.dbf

521M    /u01/app/oracle/oradata/prod/sysaux01.dbf

 

[root@getlnx01 u03]# find . -type f -size +800M  -print0 | xargs -0 du -h

1.3G    ./flash_recovery_area/backup/backupsets/ora_df873519197_s46815_s1

1.1G    ./flash_recovery_area/backup/backupsets/ora_df873523646_s46822_s1

1.2G    ./flash_recovery_area/backup/backupsets/ora_df873521714_s46818_s1

1.2G    ./flash_recovery_area/backup/backupsets/ora_df873522876_s46820_s1

1.5G    ./flash_recovery_area/backup/backupsets/ora_df873517396_s46813_s1

1.1G    ./flash_recovery_area/backup/backupsets/ora_df873523321_s46821_s1

1.3G    ./flash_recovery_area/backup/backupsets/ora_df873515765_s46811_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873520789_s46817_s1

1004M   ./flash_recovery_area/backup/backupsets/ora_df873524162_s46823_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873518302_s46814_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873519953_s46816_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873516500_s46812_s1

2.6G    ./flash_recovery_area/backup/backupsets/ora_df873513413_s46809_s1

1.8G    ./flash_recovery_area/backup/backupsets/ora_df873514789_s46810_s1

4.1G    ./oradata/epps/invsubmat_d08.dbf

4.0G    ./oradata/epps/gmtinv_d08.dbf

4.1G    ./oradata/epps/gmtinv_x01.dbf

8.1G    ./oradata/epps/undotbs02.dbf

4.1G    ./oradata/epps/gmtinv_d07.dbf

8.1G    ./oradata/epps/undotbs01.dbf

4.1G    ./oradata/epps/gmtinv_x02.dbf
[root@getlnx01 u03]# find . -type f -size +800M  -print0 | xargs -0 du -h

1.3G    ./flash_recovery_area/backup/backupsets/ora_df873519197_s46815_s1

1.1G    ./flash_recovery_area/backup/backupsets/ora_df873523646_s46822_s1

1.2G    ./flash_recovery_area/backup/backupsets/ora_df873521714_s46818_s1

1.2G    ./flash_recovery_area/backup/backupsets/ora_df873522876_s46820_s1

1.5G    ./flash_recovery_area/backup/backupsets/ora_df873517396_s46813_s1

1.1G    ./flash_recovery_area/backup/backupsets/ora_df873523321_s46821_s1

1.3G    ./flash_recovery_area/backup/backupsets/ora_df873515765_s46811_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873520789_s46817_s1

1004M   ./flash_recovery_area/backup/backupsets/ora_df873524162_s46823_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873518302_s46814_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873519953_s46816_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873516500_s46812_s1

2.6G    ./flash_recovery_area/backup/backupsets/ora_df873513413_s46809_s1

1.8G    ./flash_recovery_area/backup/backupsets/ora_df873514789_s46810_s1

4.1G    ./oradata/epps/invsubmat_d08.dbf

4.0G    ./oradata/epps/gmtinv_d08.dbf

4.1G    ./oradata/epps/gmtinv_x01.dbf

8.1G    ./oradata/epps/undotbs02.dbf

4.1G    ./oradata/epps/gmtinv_d07.dbf

8.1G    ./oradata/epps/undotbs01.dbf

4.1G    ./oradata/epps/gmtinv_x02.dbf

三.二 查找下边目录(/u01)中的大文件

[root@Oracle11g ~]#  find /u01/app/oracle/  -type f -size +500M  -print0 | xargs -0 ls -lh  | sort -nr

-rw-r----- 1 oracle oinstall 711M 11-20 09:41 /u01/app/oracle/oradata/prod/system01.dbf
-rw-r----- 1 oracle oinstall 521M 11-20 09:36 /u01/app/oracle/oradata/prod/sysaux01.dbf 

1.5查找钦定目录下超越内定大小的公文(按大小排序,严谨的)

可是如上截图所示,有时候排列的逐壹并不完全是按大小一样,那么些是因为du命令的参数h所致,你可以统一运用使用MB来彰显,这样就能减轻那个主题素材

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/ -type f -size +500M -print0 | xargs -0 du -hm | sort –n

 

521     /u01/app/oracle/oradata/prod/sysaux01.dbf

711     /u01/app/oracle/oradata/prod/system01.dbf

澳门金沙国际 5

澳门金沙国际 6

一.陆 寻找钦点目录下超越内定大小的文件(详细彰显文件的属主、属组、文件大小(M为单位))

[oracle@Oracle11g ~]$ find /u01/app/oracle/oradata/prod/  -type f -size +500M  -print0 | xargs -0 ls -lh  | sort -nr

rw-r—– 1 oracle oinstall 711M 11-20 09:06 /u01/app/oracle/oradata/prod/system01.dbf
-rw-r—– 1 oracle oinstall 521M 11-20 09:06 /u01/app/oracle/oradata/prod/sysaux01.dbf

 

 

 

 

 

2 什么样查找Linux下的大目录

譬如有时候磁盘空间告警了,而你平时又疏于管理、监察和控制文件的滋长,那么自个儿索要急迅的打听什么目录变得非常大,那么此时大家能够借助du命令来帮大家缓慢解决那么些标题

 

假若你还亟需对寻觅结果依据文件大小做3个排序,那么能够运用上面发号施令

借使您还要求对寻觅结果依据文件大小做一个排序,那么能够使用上边发号施令

2.壹寻觅钦定目录下的大目录

[oracle@Oracle11g ~]$ du -h /u01  –max-depth=1

5.7G    /u01/app

16K     /u01/lost+found

5.7G    /u01

[oracle@Oracle11g ~]$ du -h /u01  –max-depth=2

2.6M    /u01/app/oraInventory

5.7G    /u01/app/oracle

5.7G    /u01/app

16K     /u01/lost+found

5.7G    /u01

[oracle@Oracle11g ~]$ du -h /u01  –max-depth=3

16K     /u01/app/oraInventory/ContentsXML

8.0K    /u01/app/oraInventory/oui

2.6M    /u01/app/oraInventory/logs

2.6M    /u01/app/oraInventory

1.7G    /u01/app/oracle/oradata

4.0K    /u01/app/oracle/checkpoints

4.0G    /u01/app/oracle/product

716K    /u01/app/oracle/admin

232K    /u01/app/oracle/cfgtoollogs

6.8M    /u01/app/oracle/diag

5.7G    /u01/app/oracle

5.7G    /u01/app

16K     /u01/lost+found

5.7G    /u01

 

假如你想知道/u01目录下边有何样大文件夹,那么可以将参数max-depth=贰,若是你想对搜索出来的结果开始展览排序,那么能够正视sort命令。如下所示

[oracle@Oracle11g ~]$ du -h /u01  –max-depth=2 |sort -n

2.6M    /u01/app/oraInventory

5.7G    /u01

5.7G    /u01/app

5.7G    /u01/app/oracle

16K     /u01/lost+found

[oracle@Oracle11g ~]$ du -h /u01  –max-depth=3 |sort -n

1.7G    /u01/app/oracle/oradata

2.6M    /u01/app/oraInventory

2.6M    /u01/app/oraInventory/logs

4.0G    /u01/app/oracle/product

4.0K    /u01/app/oracle/checkpoints

5.7G    /u01

5.7G    /u01/app

5.7G    /u01/app/oracle

6.8M    /u01/app/oracle/diag

8.0K    /u01/app/oraInventory/oui

16K     /u01/app/oraInventory/ContentsXML

16K     /u01/lost+found

232K    /u01/app/oracle/cfgtoollogs

716K    /u01/app/oracle/admin

 

突发性寻觅出来的结果太多了(譬如,笔者从根目录起始研究),向来在刷屏,借使自个儿只想获悉最大的陆个公文夹,如何是好吧?此时快要借助head命令来展现了

[oracle@Oracle11g ~]$ du -hm /u01/app/oracle/ –max-depth=2 | sort -nr | head -5

5741    /u01/app/oracle/

4057    /u01/app/oracle/product/11.2.0

4057    /u01/app/oracle/product

1677    /u01/app/oracle/oradata/prod

1677    /u01/app/oracle/oradata

[root@getlnx01 u03]# find . -type f -size +800M  -print0 | xargs -0 du -h | sort -nr

1004M   ./flash_recovery_area/backup/backupsets/ora_df873524162_s46823_s1

8.1G    ./oradata/epps/undotbs02.dbf

8.1G    ./oradata/epps/undotbs01.dbf

4.1G    ./oradata/epps/invsubmat_d08.dbf

4.1G    ./oradata/epps/gmtinv_x02.dbf

4.1G    ./oradata/epps/gmtinv_x01.dbf

4.1G    ./oradata/epps/gmtinv_d07.dbf

4.0G    ./oradata/epps/gmtinv_d08.dbf

2.6G    ./flash_recovery_area/backup/backupsets/ora_df873513413_s46809_s1

1.8G    ./flash_recovery_area/backup/backupsets/ora_df873514789_s46810_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873520789_s46817_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873519953_s46816_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873518302_s46814_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873516500_s46812_s1

1.5G    ./flash_recovery_area/backup/backupsets/ora_df873517396_s46813_s1

1.3G    ./flash_recovery_area/backup/backupsets/ora_df873519197_s46815_s1

1.3G    ./flash_recovery_area/backup/backupsets/ora_df873515765_s46811_s1

1.2G    ./flash_recovery_area/backup/backupsets/ora_df873522876_s46820_s1

1.2G    ./flash_recovery_area/backup/backupsets/ora_df873521714_s46818_s1

1.1G    ./flash_recovery_area/backup/backupsets/ora_df873523646_s46822_s1

1.1G    ./flash_recovery_area/backup/backupsets/ora_df873523321_s46821_s1
[root@getlnx01 u03]# find . -type f -size +800M  -print0 | xargs -0 du -h | sort -nr

1004M   ./flash_recovery_area/backup/backupsets/ora_df873524162_s46823_s1

8.1G    ./oradata/epps/undotbs02.dbf

8.1G    ./oradata/epps/undotbs01.dbf

4.1G    ./oradata/epps/invsubmat_d08.dbf

4.1G    ./oradata/epps/gmtinv_x02.dbf

4.1G    ./oradata/epps/gmtinv_x01.dbf

4.1G    ./oradata/epps/gmtinv_d07.dbf

4.0G    ./oradata/epps/gmtinv_d08.dbf

2.6G    ./flash_recovery_area/backup/backupsets/ora_df873513413_s46809_s1

1.8G    ./flash_recovery_area/backup/backupsets/ora_df873514789_s46810_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873520789_s46817_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873519953_s46816_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873518302_s46814_s1

1.6G    ./flash_recovery_area/backup/backupsets/ora_df873516500_s46812_s1

1.5G    ./flash_recovery_area/backup/backupsets/ora_df873517396_s46813_s1

1.3G    ./flash_recovery_area/backup/backupsets/ora_df873519197_s46815_s1

1.3G    ./flash_recovery_area/backup/backupsets/ora_df873515765_s46811_s1

1.2G    ./flash_recovery_area/backup/backupsets/ora_df873522876_s46820_s1

1.2G    ./flash_recovery_area/backup/backupsets/ora_df873521714_s46818_s1

1.1G    ./flash_recovery_area/backup/backupsets/ora_df873523646_s46822_s1

1.1G    ./flash_recovery_area/backup/backupsets/ora_df873523321_s46821_s1

三.和睦收十的(实用的)

澳门金沙国际 7

澳门金沙国际 8

3.1 查找系统中的大目录(从大到小排序,取前五个)

[root@Oracle11g ~]# du -hm / –max-depth=1 | sort -nr | head -5

9456    /
5744    /u01
2964    /usr
260     /dev
234     /lib

唯独如上截图所示,有时候排列的种种并不完全是按大小同样,这么些是因为du命令的参数h所致,你能够统一使用使用MB来突显,那样就能一举成功这些标题。到那边,这些在Linux系统查找大文件的通令已经尤其完美了,当然要是您还有不少的供给,那么能够在那一个命令上做修改、调度.

唯独如上截图所示,有时候排列的逐一并不完全是按大小一样,这么些是因为du命令的参数h所致,你能够统一运用使用MB来呈现,那样就能缓和那些主题材料。到此处,那些在Linux系统查找大文件的通令已经尤其全面了,当然要是您还有大多的供给,那么能够在那个命令上做修改、调解.

三.二 查找上边目录(/u0一)中的大文件

[root@Oracle11g ~]#  find /u01/app/oracle/  -type f -size +500M  -print0 | xargs -0 ls -lh  | sort -nr

 

-rw-r—– 1 oracle oinstall 711M 11-20 09:41 /u01/app/oracle/oradata/prod/system01.dbf
-rw-r—– 1 oracle oinstall 521M 11-20 09:36 /u01/app/oracle/oradata/prod/sysaux01.dbf 

 

嘿嘿,挺实用的

 

澳门金沙国际 9

澳门金沙国际 10

 

 

二:
怎样查找Linux下的大目录

二:
如何查找Linux下的大目录

譬如有时候磁盘空间告警了,而你常常又疏于管理、监察和控制文件的巩固,那么自身急需快捷的询问哪些目录变得非常的大,那么此时咱们能够借助du命令来帮大家缓和这一个标题。

譬如说有时候磁盘空间告警了,而你经常又疏于管理、监察和控制文件的提升,那么作者急需火速的摸底怎么目录变得一点都不小,那么此时我们得以借助du命令来帮我们解决这几个题目。

[root@getlnx01 u03]# du -h --max-depth=1

16K     ./lost+found

33G     ./flash_recovery_area

37G     ./oradata

70G     .
[root@getlnx01 u03]# du -h --max-depth=1

16K     ./lost+found

33G     ./flash_recovery_area

37G     ./oradata

70G     .

假定您想清楚flash_recovery_area目录下边有怎么样大文件夹,那么能够将参数max-depth=2,假设您想对寻觅出来的结果实行排序,那么能够依靠sort命令。如下所示

若果您想知道flash_recovery_area目录上面有何样大文件夹,那么能够将参数max-depth=二,借使你想对寻觅出来的结果进行排序,那么能够依靠sort命令。如下所示

[root@getlnx01 u03]# du -h --max-depth=2 | sort -n

3.5G    ./flash_recovery_area/EPPS

16K     ./lost+found

29G     ./flash_recovery_area/backup

33G     ./flash_recovery_area

37G     ./oradata

37G     ./oradata/epps

70G     .

[root@getlnx01 u03]# du -hm --max-depth=2 | sort -n

1       ./lost+found

3527    ./flash_recovery_area/EPPS

29544   ./flash_recovery_area/backup

33070   ./flash_recovery_area

37705   ./oradata

37705   ./oradata/epps

70775   .
[root@getlnx01 u03]# du -h --max-depth=2 | sort -n

3.5G    ./flash_recovery_area/EPPS

16K     ./lost+found

29G     ./flash_recovery_area/backup

33G     ./flash_recovery_area

37G     ./oradata

37G     ./oradata/epps

70G     .

[root@getlnx01 u03]# du -hm --max-depth=2 | sort -n

1       ./lost+found

3527    ./flash_recovery_area/EPPS

29544   ./flash_recovery_area/backup

33070   ./flash_recovery_area

37705   ./oradata

37705   ./oradata/epps

70775   .

澳门金沙国际 11

澳门金沙国际 12

[root@getlnx01 u03]#
cd /

[root@getlnx01 u03]#
cd /

[root@getlnx01 /]# du
-hm –max-depth=2 | sort -n

[root@getlnx01 /]# du
-hm –max-depth=2 | sort -n

偶尔寻寻觅来的结果太多了(譬如,作者从根目录初叶物色),一贯在刷屏,借使自个儿只想获悉最大的拾贰个文本夹,如何是好吧?此时将要借助head命令来展示了

有时候寻找出来的结果太多了(譬如,作者从根目录起首物色),平昔在刷屏,假设本人只想获悉最大的13个文本夹,如何做吧?此时就要借助head命令来彰显了

[root@getlnx01 /]# du -hm --max-depth=2 | sort -nr | head -12

407480  .

167880  ./u04

158685  ./u02/oradata

158685  ./u02

152118  ./u04/oradata

70775   ./u03

37705   ./u03/oradata

33070   ./u03/flash_recovery_area

5995    ./u01/app

5995    ./u01

3551    ./usr

1558    ./usr/share

[root@getlnx01 /]# 
[root@getlnx01 /]# du -hm --max-depth=2 | sort -nr | head -12

407480  .

167880  ./u04

158685  ./u02/oradata

158685  ./u02

152118  ./u04/oradata

70775   ./u03

37705   ./u03/oradata

33070   ./u03/flash_recovery_area

5995    ./u01/app

5995    ./u01

3551    ./usr

1558    ./usr/share

[root@getlnx01 /]# 

澳门金沙国际 13

澳门金沙国际 14

 

 

相关文章