« iptables port redirection (smtp servers). | Main | rkhunter ... doesn't support redhat ES 4 (nahant update 3)? »

finding files with specific permissions.

in may, we did a plesk migration from an older server to a newer one. it was relatively smooth, but for some reason, a lot of image permissions were not kept intact (instead being read+write only by the owner, but not the user or group).

i am beginning to learn how useful the find command is. this code snippet below enabled me to find all of the jpg images on my server that were chmodded 600 ... and made them appropriately readable.

# find /home/httpd/vhosts -name '*.jpg' -perm 600

but wait, you can execute commands on these results too!

# find /hme/httpd/vhosts/ -name '*.jpg' -perm 600 -exec chmod 644 {} \;

good stuff!

TrackBack

TrackBack URL for this entry:
http://www.ramblingsofasysadmin.com/cgi-bin/mt/mt-tb.cgi/19

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)