SQL> shutdown abort .com

About DBA Queries DBA Scripts Quick Guides Nooleus tnsManager Other Stuff Contact
Andy only 
 

Miscellaneous - Useful UNIX


Find/Zip/Move/Delete files older than x days
find ./ -name "*.ARC" -mtime +1 -exec ls -l {} \;

find ./ -name "*.ARC" -mtime +1 -exec rm {} \;

find ./ -name "*.ARC" -mtime +1 -exec gzip {} \;

find ./ -name "*.arch" -mtime +1 -exec mv {} /u01/andy/;
Delete the 500 oldest files
rm -f `ls -tr|head -500`
Find and grep
find ./ -grep <what> {} \; -print 2>/dev/null
Or...
find ./ -exec grep -l "string" {} \;
list all files opened by a process
lsof -p <pid>
ls -l sorted by size
ls -l |sort -k 5

du -sk *|sort -n
cpio unzip syntax
cpio -idmv < <filename>
man commands
man -k <what> -displays the chapters containing the specified
man <chapter> <what> -shows the page
pipes
mknod <name> p
Turn off auto indent and bracket matching in vi
:set noai nosm
Capture a control charater
ctl-v then press the control key (eg. backspace)
Configure ksh environment
To display the current settings
set -o
To set HP/UX stylee...
set -o vi
set -o vi-esccomplete
Show routing tables
netstat -r
Check all logs for ORA- errors
grep ^ORA- *log |cut -f2 -d"-"|cut -f1 -d:|awk '{print "ORA-" $1}'|sort -u
Copyright© 2007-2010 Andrew Barry