Linux下搜索大文件以及目录,Linux如何搜索大文件或目录总括

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

原帖地址:

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

Linux下搜索大文件以及目录,Linux如何搜索大文件或目录总括。转自:

转自:

今日刚刚赶过这样的主题素材,在和讯中看出有以上地点的1篇著作,照着地点的操作消除了难题,可是排版上望着不是专门舒服,自个儿也想记录下来,就全文COPY了,只是改了下版式。望笔者谅解

 

在Windows系统中,大家能够运用TreeSize工具搜索一些大文件或文件夹,卓殊的方便快捷,在Linux系统中,如何去寻觅一些十分的大的公文呢?上面小编整理了一晃在Linux系统中怎么着搜索大文件或文件夹的章程。

在Windows系统中,大家可以使用TreeSize工具寻觅一些大文件或文件夹,卓殊的有益高效,在Linux系统中,如何去追寻一些非常的大的公文呢?下边作者整理了1晃在Linux系统中什么寻觅大文件或文件夹的措施。

一 怎么样找出大文件

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

美高梅手机版4858 , 

 

 

一.一查找钦命目录下超越钦赐大小的文件

举例笔者要物色 /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轻重缓急的文本的文件名称,不过对文本的音信(举个例子,文件大小、文件属性)一无所知,那么是还是不是更详尽展现一些文件属性或音信呢,当然能够

原帖地址: 
多谢潇湘隐者,谢谢这几个

一:
怎样寻觅大文件?

壹:
如何搜索大文件?

壹.2索求钦点目录下当先钦命大小的文本(展现文件用户、属组)

[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高低的文书

骨子里过多时候,你需求精通当下系统下有哪些大文件,比方文件大小超越拾0M或1G(阀值视具体意况而定)。那么怎样把这么些大文件找寻出来吧?举例小编要物色当前目录下,超越800M分寸的公文

1.三招来钦命目录下超过钦命大小的文件(展现文件详细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

壹.四招来钦点目录下抢先钦命大小的文本(按大小排序,结果有出入)

假若你还索要对寻觅结果依据文件大小做2个排序,那么能够选择上面发号施令

[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系统中怎样搜索大文件或文件夹的艺术。

美高梅手机版4858 1

美高梅手机版4858 2

1.伍追寻内定目录下当先钦点大小的文本(按大小排序,严谨的)

唯独如上截图所示,有时候排列的依次并不完全是按大小一样,那些是因为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

 

 

 

一.陆 搜索钦定目录下超过内定大小的文书(详细突显文件的属主、属组、文件大小(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或一G(阀值视具体情状而定)。那么什么样把那些大文件搜索出来吗?

如上命令所示,我们只是能看出当先800M高低的公文的文件名称,可是对文本的音信(举个例子,文件大小、文件属性)一窍不通,那么是不是更详尽呈现一些文件属性或音讯吗,当然能够,如下所示

如上命令所示,大家唯有能见到超越800M分寸的文书的文件名称,但是对文本的信息(比方,文件大小、文件属性)一窍不通,那么是或不是更详实呈现一些文件属性或消息吗,当然能够,如下所示

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

诸如有时候磁盘空间告警了,而你日常又疏于管理、监察和控制文件的滋长,那么作者急需神速的打听哪些目录变得非常大,那么此时大家能够借助du命令来帮大家减轻那个难题

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轻重的公文的文件名称,可是对文件的信息(比如,文件大小、文件属性)一窍不通,那么是不是更详实彰显一些文件属性或音信吗,当然能够

[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

二.壹寻找钦命目录下的大目录

[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

一.2追寻内定目录下当先钦定大小的文书(彰显文件用户、属组)

[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

 

美高梅手机版4858 3

美高梅手机版4858 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分寸文件,并展现查找寻来文件的切切实实尺寸,能够利用上边发号施令

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

[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 

一.5探索钦赐目录下超越内定大小的文件(按大小排序,严谨的)

而是如上截图所示,有时候排列的11并不完全是按大小同等,这么些是因为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

美高梅手机版4858 5

美高梅手机版4858 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命令来帮大家化解那些标题

 

要是您还亟需对寻找结果遵照文件大小做三个排序,那么可以选取下边发号施令

要是你还索要对寻找结果依据文件大小做七个排序,那么能够使用上边发号施令

二.一搜索钦赐目录下的大目录

[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

 

突发性搜索出来的结果太多了(譬如,笔者从根目录起头寻觅),一贯在刷屏,如若自身只想获悉最大的6个文件夹,咋做吧?此时就要借助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

三.融洽收10的(实用的)

美高梅手机版4858 7

美高梅手机版4858 8

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

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

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

而是如上截图所示,有时候排列的各类并不完全是按大小一样,这一个是因为du命令的参数h所致,你能够统1使用应用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 

 

嘿嘿,挺实用的

 

美高梅手机版4858 9

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

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

假定你想明白flash_recovery_area目录下边有何样大文件夹,那么可以将参数max-depth=2,假如您想对搜索出来的结果开展排序,那么能够依附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   .

美高梅手机版4858 11

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

偶尔寻找出来的结果太多了(譬如,笔者从根目录初阶搜求),一贯在刷屏,要是作者只想获悉最大的12个文本夹,咋办呢?此时快要借助head命令来显示了

突发性寻找寻来的结果太多了(譬如,作者从根目录开端搜寻),向来在刷屏,假设本人只想获悉最大的拾三个公文夹,如何是好吧?此时将在借助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 /]# 

美高梅手机版4858 13

美高梅手机版4858 14

 

 

发表评论

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

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