FIND COMMAND


1. Removing files older than 14 Days from the current working directory
find . -type f -mtime +14 -exec rm -f {} \;
2. Finding the top 5 largest files from the current working directory
find . -ls | sort -nrk 7 | head -5
3. Find files larger than 100MB from the current working directory
find . -size +100000k
4. Delete audit records that’s older than 30 days
find $ORACLE_HOME/rdbms/audit -name "*.aud" -mtime +30 -exec rm {} \;
5. Delete files in /tmp that’s older than 30 days
find /tmp -group dba -type f -mtime +5 -exec rm -f {} \;
find /tmp/dba -group dba -type f -mtime +5 -exec rm -f {} \;
6. Delete *.trc files more than 5 days old.
find $TRACE_DIR -name '*.trc' -type f -mtime +5 -exec rm {} \;
Useful link; http://www.dbaexpert.com/blog/find-command-tips-for-dbas/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: