Wednesday, 3 July 2013

Find Command usage

Hi

find . -size +100000 -exec ls -ltr {} \; -------------- with date
find . -size +100000 -mtime +60 -exec ls -ltr {} \; --------------- older then 60 days
find ./. -name "core*" -mtime +90 -type f -exec gzip {} \; ---------------- ZIP file older then 90 dayes with name like : core
find / -name aler*.log ------- alertlog file
find / -name creamp_hot_backup.ksh find file name on filesystem
find . -name '*.aud' -exec ls -lrt {} \; -------------- list from / all audit files
find . -name \*.gz -mtime +150 -exec ls -lrt {} \; delete file with aud older then 15 days
find / -name *.sh -------------- to find .sh script
find /orcl/app/oracle/diag/asm/+asm/+ASM1/trace -type f -mtime +3 -exec ls -lrt {} \; ---------> will list file older the 3 days at that mount point.
find . -name \*+ASM1_ora* -mtime +3 -exec rm {} \; --------------------------- > WILL REMOVE FROM THAT DIRECTORY OLDER THEN 3 DAYS WITH NAME +asm
find / -name *GCRPB ----------- To find profie
find / -name *GCRPB_profile --------------- or databasename_profile
find *.sh file
find / -name *.sh 2>/dev/null
w/o permission declined msg...
more /app/clarity/var/tmp/cmdb/data/stdout.kbVVYW|head -10 -------------will show top 10 files
ls -tlr /app/clarity/var/tmp/cmdb/data|grep oracle|wc -l -------------> will give count of files
find /orcl -name emctl -type f 2>/tmp/null ------------------------> find agent and 2>/tmp/null _------> means go to no where
find / -name emctl -type f 2>/tmp/null ------------------> generic from root
nohup find . -name '*.aud' -mtime +3 -exec rm -rf {} \; & ------------> to delete audit files keepign retention of 3 days

Thanks,
sujan

No comments:

Post a Comment