Tuesday, May 8, 2007

Handy UNIX Commands for Oracle Professionals

Like to share some good and handy UNIX commands which would be really helpful support professionals


1).To find the top 10 larger files in the Directory,

$ls -lrt | awk '{print $5,$9}' | sort -nr head | xargs ls -lrt


2) To find the access and Modification details of a file

$istat

*This command is available for AIX only

3).To remove file which are older then say 7 days

$find . -mtime +7 -exec rm {} \;

4).Locate Files That Contain Certain Strings

$ find . -printxargs grep -i v\$dba_objects

5)To Delete top 10 files in directory which has huge size

use,

$du -sk sort -nr head awk '{print $2}' xargs rm -r

No comments: