如何查找大文件显示超过100M的文件[root@strong ~]# cd /u01 [root@strong u01]# pwd /u01 [root@strong u01]# find . -type f-size +100M ./app/oracle/oradata/YADATA/system01.dbf ./app/oracle/oradata/YADATA/example01.dbf ./app/oracle/oradata/YADATA/undotbs01.dbf ./app/oracle/oradata/YADATA/sysaux01.dbf ./app/oracle/product/11.2.0/db_1/lib/libserver11.a ./app/oracle/product/11.2.0/db_1/bin/oracle ./app/oracle/product/11.2.0/db_1/assistants/dbca/templates/Seed_Database.dfb ./app/oracle/product/11.2.0/db_1/javavm/admin/classes.bin [root@strong u01]#
显示文件具体的属性或信息[root@strong u01]# find . -type f -size+100M -print0 | xargs -0 ls -l -rw-r-----. 1 oracle dba 362422272 12月 15 01:03./app/oracle/oradata/YADATA/example01.dbf -rw-r-----. 1 oracle dba 576724992 12月 15 01:05./app/oracle/oradata/YADATA/sysaux01.dbf -rw-r-----. 1 oracle dba 943726592 12月 15 01:05./app/oracle/oradata/YADATA/system01.dbf -rw-r-----. 1 oracle dba 125837312 12月 15 01:05./app/oracle/oradata/YADATA/undotbs01.dbf -rwxrwxr-x. 1 oracle dba 274776064 8月 282013 ./app/oracle/product/11.2.0/db_1/assistants/dbca/templates/Seed_Database.dfb -rwsr-s--x. 1 oracle dba 198796821 6月 2813:58 ./app/oracle/product/11.2.0/db_1/bin/oracle -rw-r--r--. 1 oracle dba 125202600 7月 142013 ./app/oracle/product/11.2.0/db_1/javavm/admin/classes.bin -rw-r--r--. 1 oracle dba 154083394 6月 2813:57 ./app/oracle/product/11.2.0/db_1/lib/libserver11.a [root@strong u01]#
显示查找出来文件的具体大小[root@strongu01]# find . -type f -size +100M -print0| xargs -0 du -h 901M ./app/oracle/oradata/YADATA/system01.dbf 346M ./app/oracle/oradata/YADATA/example01.dbf 121M ./app/oracle/oradata/YADATA/undotbs01.dbf 551M ./app/oracle/oradata/YADATA/sysaux01.dbf 147M ./app/oracle/product/11.2.0/db_1/lib/libserver11.a 190M ./app/oracle/product/11.2.0/db_1/bin/oracle 263M ./app/oracle/product/11.2.0/db_1/assistants/dbca/templates/Seed_Database.dfb 120M ./app/oracle/product/11.2.0/db_1/javavm/admin/classes.bin
sort命令进行大小排序 [root@strong u01]# find . -type f -size+100M -print0 | xargs -0 du -h | sort –nr (从大往小排序) 901M ./app/oracle/oradata/YADATA/system01.dbf 551M ./app/oracle/oradata/YADATA/sysaux01.dbf 346M ./app/oracle/oradata/YADATA/example01.dbf 263M ./app/oracle/product/11.2.0/db_1/assistants/dbca/templates/Seed_Database.dfb 190M ./app/oracle/product/11.2.0/db_1/bin/oracle 147M ./app/oracle/product/11.2.0/db_1/lib/libserver11.a 121M ./app/oracle/oradata/YADATA/undotbs01.dbf 120M ./app/oracle/product/11.2.0/db_1/javavm/admin/classes.bin [root@strong u01]# [root@strongu01]# find . -type f -size +100M -print0| xargs -0 du -hm | sort –n (从小往大排序) 120 ./app/oracle/product/11.2.0/db_1/javavm/admin/classes.bin 121 ./app/oracle/oradata/YADATA/undotbs01.dbf 147 ./app/oracle/product/11.2.0/db_1/lib/libserver11.a 190 ./app/oracle/product/11.2.0/db_1/bin/oracle 263 ./app/oracle/product/11.2.0/db_1/assistants/dbca/templates/Seed_Database.dfb 346 ./app/oracle/oradata/YADATA/example01.dbf 551 ./app/oracle/oradata/YADATA/sysaux01.dbf 901 ./app/oracle/oradata/YADATA/system01.dbf 如何查找Linux下的大目录Du –h进行查找[root@strong ~]# cd /u01/app/ [root@strong app]# pwd /u01/app [root@strong app]# du -h--max-depth=1 2.8M ./oraInventory 6.9G ./oracle 6.9G . 调节depth的值,显示子目录的层级也会发生变化[root@strong app]# du -h--max-depth=2 8.0K ./oraInventory/oui 2.8M ./oraInventory/logs 16K ./oraInventory/ContentsXML 2.8M ./oraInventory 1.2G ./oracle/fast_recovery_area 652K ./oracle/cfgtoollogs 5.4M ./oracle/diag 1.8G ./oracle/oradata 4.0K ./oracle/checkpoints 360K ./oracle/admin 4.0G ./oracle/product 6.9G ./oracle 6.9G .
[root@strong app]# du -h--max-depth=3 8.0K ./oraInventory/oui 2.8M ./oraInventory/logs 16K ./oraInventory/ContentsXML 2.8M ./oraInventory 1.2G ./oracle/fast_recovery_area/YADATA 1.2G ./oracle/fast_recovery_area 344K ./oracle/cfgtoollogs/dbca 120K ./oracle/cfgtoollogs/netca 12K ./oracle/cfgtoollogs/catbundle 172K ./oracle/cfgtoollogs/emca 652K ./oracle/cfgtoollogs 872K ./oracle/diag/tnslsnr 4.0K ./oracle/diag/lsnrctl 372K ./oracle/diag/clients 4.0K ./oracle/diag/asm 4.1M ./oracle/diag/rdbms 4.0K ./oracle/diag/diagtool 4.0K ./oracle/diag/netcman 4.0K ./oracle/diag/ofm 4.0K ./oracle/diag/crs 5.4M ./oracle/diag 1.8G ./oracle/oradata/YADATA 1.8G ./oracle/oradata 4.0K ./oracle/checkpoints 356K ./oracle/admin/YADATA 360K ./oracle/admin 4.0G ./oracle/product/11.2.0 4.0G ./oracle/product 6.9G ./oracle 6.9G .
sort命令进行大小排序[root@strong app]# du -h --max-depth=3 |sort -n 1.2G ./oracle/fast_recovery_area 1.2G ./oracle/fast_recovery_area/YADATA 1.8G ./oracle/oradata 1.8G ./oracle/oradata/YADATA 2.8M ./oraInventory 2.8M ./oraInventory/logs 4.0G ./oracle/product 4.0G ./oracle/product/11.2.0 4.0K ./oracle/checkpoints 4.0K ./oracle/diag/asm 4.0K ./oracle/diag/crs 4.0K ./oracle/diag/diagtool 4.0K ./oracle/diag/lsnrctl 4.0K ./oracle/diag/netcman 4.0K ./oracle/diag/ofm 4.1M ./oracle/diag/rdbms 5.4M ./oracle/diag 6.9G . 6.9G ./oracle 8.0K ./oraInventory/oui 12K ./oracle/cfgtoollogs/catbundle 16K ./oraInventory/ContentsXML 120K ./oracle/cfgtoollogs/netca 172K ./oracle/cfgtoollogs/emca 344K ./oracle/cfgtoollogs/dbca 356K ./oracle/admin/YADATA 360K ./oracle/admin 380K ./oracle/diag/clients 652K ./oracle/cfgtoollogs 872K ./oracle/diag/tnslsnr
|