real world FIND usage

clipped from www.wagoneers.com
sudo find / -type f -name *.jpg -exec cp {} . \;
find . -type f -size +10000 -exec ls -al {} \;
find . -atime +1 -type f -exec mv {} TMP \; # mv files older then 1 day to dir TMP
find . -name “-F” -exec rm {} \; # a script error created a file called -F
find . -exec grep -i “vds admin” {} \;
find . \! -name “*.Z” -exec compress -f {} \;
find . -type f \! -name “*.Z” \! -name “.comment” -print | tee -a /tmp/list
find . -name *.ini
find . -exec chmod 775 {} \;
find . -user xuser1 -exec chown -R user2 {} \;
find . -name ebtcom*
find . -name mkbook
find . -exec grep PW0 {} \;
find . -exec grep -i “pw0” {} \;
find . -atime +6
find . -atime +6 -exec ll | more
find . -atime +6 -exec ll | more \;
find . -atime +6 -exec ll \;
find . -atime +6 -exec ls \;
find . -atime +30 -exec ls \;
find . -atime +30 -exec ls \; | wc -l
find . -name auth*
find . -exec grep -i plotme10 {};

find files modified in the last 90 days

find . -mtime -90

find . -mtime 0 # find files modified between now and 1 day ago

(i.e., within the past 24 hours)

find . -mtime -1 # find files modified less than 1 day ago

(i.e., within the past 24 hours, as before)

find . -mtime 1 # find files modified between 24 and 48 hours ago
find . -mtime +1 # find files modified more than 48 hours ago

find . -mmin +5 -mmin -10 # find files modifed between

6 and 9 minutes ago

from:

http://content.hccfl.edu/pollock/Unix/FindCmd.htm

find . -mtime -30

Related Posts:

  • No Related Posts
This entry was posted in Web Development. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *