Linux怎么着搜索大文件或目录计算

原帖地址:

转自:

Linux怎么着搜索大文件或目录总结,linux查找计算

   
在Windows系统中,大家能够使用TreeSize工具搜索一些大文件或文件夹,万分的便宜高效,在Linux系统中,怎样去找出一些十分的大的公文呢?上面作者整理了1晃在Linux系统中如何搜索大文件或文件夹的不二等秘书技。

 

一: 怎样搜索大文件?

实际上过多时候,你须求精通当下系统下有哪些大文件,举例文件大小超越十0M或一G(阀值视具体情状而定)。那么什么样把那些大文件搜索出来吗?举个例子小编要找出当前目录下,超越800M高低的文书

[[email protected] u03]# pwd

/u03

[[email protected] 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

 

如上命令所示,我们唯有能旁观超越800M尺寸的公文的文件名称,不过对文本的消息(比方,文件大小、文件属性)一窍不通,那么是或不是更详实显示一些文件属性或消息呢,当然能够,如下所示

[[email protected] 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

当大家只必要寻觅超越800M轻重文件,并出示查搜索来文件的实际大小,能够选取下边发号施令

[[email protected]nx01 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

 

假设你还索要对寻找结果遵照文件大小做二个排序,那么可以运用上面发号施令

[[email protected] 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

Linux如何搜索大文件或目录计算,Linux下找寻大文件以及目录。而是如上截图所示,有时候排列的顺序并不完全是按大小同等,这么些是因为du命令的参数h所致,你能够统一使用使用MB来展现,那样就能一下子就解决了这几个问题。到那边,那个在Linux系统查找大文件的授命已经丰硕完美了,当然假如您还有众多的须要,那么可以在这几个命令上做修改、调治.

 

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

例如说有时候磁盘空间告警了,而你经常又疏于管理、监察和控制文件的加强,那么自身供给火速的刺探哪些目录变得不小,那么此时大家可以借助du命令来帮大家消除那么些主题材料。

[[email protected] u03]# du -h --max-depth=1

16K     ./lost+found

33G     ./flash_recovery_area

37G     ./oradata

70G     .

设若您想明白flash_recovery_area目录上边有啥样大文件夹,那么能够将参数max-depth=贰,若是你想对搜索出来的结果开始展览排序,那么能够信赖sort命令。如下所示

[[email protected] 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     .

[[email protected] 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   .

[[email protected]
u03]# cd /

[[email protected]
/]# du -hm –max-depth=2 | sort -n

神蹟找寻出来的结果太多了(譬如,作者从根目录开首找出),平素在刷屏,借使自个儿只想获悉最大的拾个文件夹,如何是好吧?此时快要借助head命令来展现了

[[email protected] /]# 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

[[email protected] /]# 

澳门金沙国际 , 

参考资料:

在Windows系统中,大家得以采用TreeSize工具寻觅一些大文件或文件夹,相当的方便人民群众高效,在L…

 

前几天恰恰碰着这么的标题,在新浪中来看有以上地点的一篇文章,照着方面包车型地铁操作消除了难点,然而排版上看着不是专程舒服,本人也想记录下来,就全文COPY了,只是改了下版式。望小编谅解

在Windows系统中,我们得以选拔TreeSize工具寻觅一些大文件或文件夹,非凡的方便高效,在Linux系统中,怎么着去研究一些相当大的文书呢?上边小编整理了弹指间在Linux系统中如何寻觅大文件或文件夹的艺术。

 

一 怎么着搜索大文件

骨子里过多时候,你须求精晓 /u01/app/oracle/oradata/prod/
下有何样大的数据文件,比方文件大小当先100M或一G(阀值视具体意况而定)。那么怎么着把那一个大文件寻觅出来吧?

 

原帖地址: 
多谢潇湘隐者,多谢那么些

一.一搜索钦点目录下超越钦赐大小的文书

譬如说作者要物色 /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高低的文书的文件名称,可是对文本的新闻(比方,文件大小、文件属性)一窍不通,那么是不是更详尽显示一些文件属性或新闻呢,当然能够

1:
怎么样搜索大文件?

 

壹.二招来内定目录下超越钦定大小的文本(展现文件用户、属组)

[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

骨子里过多时候,你要求了然当下系统下有哪些大文件,比方文件大小超越100M或一G(阀值视具体景况而定)。那么如何把那一个大文件找寻出来吧?比如作者要索求当前目录下,超越800M分寸的公文

 

一.叁寻觅钦点目录下超越内定大小的公文(展现文件详细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

在Linux系统中,怎样去索求一些极大的文件呢?上面笔者收拾了弹指间在Linux系统中怎样寻觅大文件或文件夹的法子。

壹.肆物色钦命目录下超越钦赐大小的文本(按大小排序,结果有出入)

假定您还索要对搜索结果根据文件大小做一个排序,那么能够采取下边发号施令

[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

澳门金沙国际 1

 

一.伍追寻钦命目录下超越钦赐大小的公文(按大小排序,严刻的)

不过如上截图所示,有时候排列的逐壹并不完全是按大小同等,那一个是因为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 怎么寻觅大文件

实质上过多时候,你需求掌握 /u01/app/oracle/oradata/prod/
下有何大的数据文件,举个例子文件大小抢先十0M或一G(阀值视具体意况而定)。那么什么样把这么些大文件寻找出来吗?

壹.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

如上命令所示,大家只有能观看当先800M大大小小的文本的文件名称,但是对文本的消息(比如,文件大小、文件属性)一窍不通,那么是不是更详实展现一些文件属性或音信呢,当然可以,如下所示

壹.一搜索钦定目录下抢先内定大小的文书

比如说笔者要探求 /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分寸的文本的文件名称,然则对文件的新闻(举个例子,文件大小、文件属性)一窍不通,那么是不是更详实显示一些文件属性或音信吗,当然能够

二 如何查找Linux下的大目录

例如有时候磁盘空间告警了,而你平常又疏于管理、监察和控制文件的拉长,那么小编须求急速的问询什么目录变得相当的大,那么此时大家得以借助du命令来帮我们缓慢解决这些主题材料

[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

壹.二追寻钦定目录下超过钦赐大小的公文(呈现文件用户、属组)

[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

 

二.1搜索钦点目录下的大目录

[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

澳门金沙国际 2

一.三物色钦定目录下抢先内定大小的文件(展现文件详细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

 

3.自个儿收拾的(实用的)

当我们只须要研究超越800M轻重文件,并呈现查搜索来文件的具体大小,能够行使下边发号施令

一.四寻找钦点目录下超越钦命大小的文书(按大小排序,结果有出入)

万一你还须求对找寻结果依照文件大小做三个排序,那么能够动用上边发号施令

[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@Oracle11g ~]# du -hm / --max-depth=1 | sort -nr | head -5

9456    /
5744    /u01
2964    /usr
260     /dev
234     /lib
[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

壹.5追寻钦赐目录下超越钦赐大小的文书(按大小排序,严苛的)

不过如上截图所示,有时候排列的顺序并不完全是按大小同等,那么些是因为du命令的参数h所致,你能够统1使用使用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

3.二 查找上边目录(/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 

澳门金沙国际 3

一.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命令来帮大家缓和那一个难题

 

只要您还亟需对寻觅结果依据文件大小做叁个排序,那么能够运用下边发号施令

二.1搜索钦点目录下的大目录

[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

[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

三.本人收十的(实用的)

澳门金沙国际 4

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

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

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

可是如上截图所示,有时候排列的次第并不完全是按大小同样,那几个是因为du命令的参数h所致,你可以统一使用使用MB来展现,那样就能一蹴而就这一个主题素材。到那边,那一个在Linux系统查找大文件的下令已经1贰分健全了,当然借使您还有为数不少的急需,那么能够在那些命令上做修改、调治.

三.2 查找上面目录(/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 

 

哈哈,挺实用的

 

澳门金沙国际 5

 

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

举个例子有时候磁盘空间告警了,而你平日又疏于管理、监控文件的升高,那么自个儿急需急速的刺探哪些目录变得不小,那么此时我们能够借助du命令来帮大家缓和这几个难点。

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

16K     ./lost+found

33G     ./flash_recovery_area

37G     ./oradata

70G     .

尽管您想明白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   .

澳门金沙国际 6

[root@getlnx01 u03]#
cd /

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

偶然寻找出来的结果太多了(譬如,笔者从根目录开头索求),一直在刷屏,要是本身只想获悉最大的十三个公文夹,怎么办吧?此时快要借助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 /]# 

澳门金沙国际 7

 

相关文章