Linux下搜索大文件以及目录,Linux怎样寻觅大文件或目录总计

By admin in 美高梅手机版4858 on 2019年4月21日

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

原帖地址:

转自:

Linux怎样搜索大文件或目录计算,linux查找总括

   
在Windows系统中,大家能够使用TreeSize工具搜索一些大文件或文件夹,非凡的有益高效,在Linux系统中,怎么样去寻觅一些比比较大的文件呢?上面小编收十了须臾间在Linux系统中哪些找出大文件或文件夹的点子。

 

一: 怎样寻找大文件?

美高梅手机版4858 ,实质上过多时候,你供给明白当前系统下有哪些大文件,举例文件大小超越100M或一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

而是如上截图所示,有时候排列的逐条并不完全是按大小同样,那几个是因为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=2,即使你想对寻觅出来的结果开始展览排序,那么能够依靠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

突发性搜索出来的结果太多了(譬如,小编从根目录早先探求),一向在刷屏,假如自个儿只想获悉最大的13个公文夹,如何做吧?此时快要借助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…

 

明天正巧蒙受那样的主题材料,在博客园中见到有上述地方的1篇小说,照着地点的操作消除了难题,可是排版上瞧着不是专门舒服,自个儿也想记录下来,就全文COPY了,只是改了下版式。望作者谅解

在Windows系统中,大家得以选择TreeSize工具搜索一些大文件或文件夹,相当的有利急忙,在Linux系统中,怎么样去寻觅一些非常的大的文本呢?下边作者收拾了一下在Linux系统中怎么样搜索大文件或文件夹的情势。

 

1 怎样寻觅大文件

其实过多时候,你须求通晓 /u01/app/oracle/oradata/prod/
下有怎样大的数据文件,举例文件大小抢先拾0M或一G(阀值视具体景况而定)。那么什么样把那个大文件寻找出来吗?

Linux下搜索大文件以及目录,Linux怎样寻觅大文件或目录总计。 

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

一.一搜寻内定目录下当先钦命大小的文书

诸如小编要寻找 /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

实质上过多时候,你要求精通当前系统下有哪些大文件,比方文件大小超越100M或一G(阀值视具体情形而定)。那么怎么样把那个大文件寻觅出来呢?举个例子笔者要物色当前目录下,超越800M大小的文本

 

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

在Linux系统中,怎么样去探究一些非常的大的公文呢?上面小编整理了1晃在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

美高梅手机版4858 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

 

1 怎么寻找大文件

实质上过多时候,你须要领悟 /u01/app/oracle/oradata/prod/
下有何样大的数据文件,举例文件大小超越100M或壹G(阀值视具体情形而定)。那么怎么样把这个大文件找出出来呢?

一.陆 寻找内定目录下超越钦赐大小的公文(详细显示文件的属主、属组、文件大小(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尺寸的文书的文件名称,可是对文件的新闻(举个例子,文件大小、文件属性)一窍不通,那么是不是更详尽显示一些文件属性或新闻吗,当然能够,如下所示

1.①找寻内定目录下超过内定大小的文本

举个例子作者要搜索 /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

 

二.一搜寻钦定目录下的大目录

[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=贰,假设你想对找出出来的结果开始展览排序,那么能够借助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

美高梅手机版4858 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

 

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

当大家只须求搜索超越800M分寸文件,并出示查找寻来文件的实际尺寸,能够利用下边发号施令

1.四搜求钦定目录下超越钦点大小的文本(按大小排序,结果有出入)

假定你还须要对寻觅结果依据文件大小做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@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所致,你能够统一使用使用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

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

美高梅手机版4858 3

一.陆 寻找内定目录下超过钦赐大小的文件(详细呈现文件的属主、属组、文件大小(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个排序,那么能够选取上面发号施令

二.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=贰,假若您想对搜索出来的结果举办排序,那么能够注重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

3.温馨收十的(实用的)

美高梅手机版4858 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系统查找大文件的命令已经尤其周全了,当然要是你还有众多的急需,那么能够在那么些命令上做修改、调度.

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

 

嘿嘿,挺实用的

 

美高梅手机版4858 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   .

美高梅手机版4858 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 /]# 

美高梅手机版4858 7

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图
Copyright @ 2010-2019 美高梅手机版4858 版权所有