The find command is used to locate files on a Unix or Linux system. 'find' will search any set of directories you specify for files that match the supplied search criteria. You can search for files by name, owner, group, type, permissions, date, and other criteria. The search is recursive in that it will search all sub-directories too. |
|
|
Working with files & directories |
|
# find / -name my_text_file -print
# find . -type f -print
# find . -name rman\*dbuat01
# find . -name \*.sh
# find . -iname \*.sh
# find . -type d -print
# find . /tmp /var/tmp $ORACLE_HOME -name dbuat01 -print
# find . -type d -mtime -7 | xargs tar -rf weekly_backup.tar
# gzip weekly_backup.tar
# tar -zxvf weekly_backup.tar.gz
# find . -name dbuat01_bkp | xargs /bin/rm -f
# find . -name dbuat01_bkp -exec /bin/rm -f '{}' \;
# find / -mmin -10
# find . -name \r* -user oracle -print
# find . -perm -o=w
# find . -mtime 0
# find . -mtime -1
# find . -mtime 1
# find . -mtime +1
# find . -mmin +5 -mmin -10
# find -type d -exec ls -d1 {} \; | cut -c 3-
# find . -mtime 1
# find . -mtime -1
# find . -mtime +1
# find . -perm 644
# find . -name "*.tmp" -print | xargs rm -f
# find . -maxdepth 1 -type f -newer first_file
# find . -type f -cmin 15 -prune
# find . -size +1000c -exec ls -l {} \;
# find . -size +10000c -size -50000c -print
# find . -mtime +10 -size +50000c -exec ls -l {} \;
# find . -type l -print | xargs ls -ld | awk '{print $10}'
# find . -name "*equity*" -print
# find . -name "*equity*" -print0 | xargs -0 ls -l
# find . -name "*arc_jul12*" -print | xargs -0 ls -l
# !find
# find . -type f -exec ls -s {} \; | sort -n -r | head -1
# find . -type f -exec ls -s {} \; | sort -n | head -1
# find . -type f -exec ls -s {} \; | sort -n -r | tail -1
# find . -maxdepth 1 -type d
# find . -size 10M
# find . -size +10M
# find . -size -10M
# find . -type f -mtime -2 -exec du -sk {} \; | sort -rn
# find /u01/oradata/dbuat01/archive -iname *.arc -type f -mmin +15 -exec gzip {} \;
# find /u01/oradata/dbuat01/backup/ -type f -mtime +6 -exec rm {} \;
|
|
[ Top ] |
|
Last modified: Jul 03, 2012 10:45 IST |
No comments:
Post a Comment