Thread: Help with chmod
View Single Post
Old 01-15-2007, 10:45 AM  
darksoul
Confirmed User
 
darksoul's Avatar
 
Join Date: Apr 2002
Location: /root/
Posts: 4,997
Quote:
Originally Posted by Calvinguy View Post
Thanks,

Never seen it like this before. Can you explain how it's working?
I assume you've seen stuff like:
Code:
chmod -R 777 /path/to/dir
which for your 1st phase would work fine (except that it would chmod everything to 777 not just jpg's and directories).

To reverse it you can't run a recursive chmod because you need different
chmod for files and directories
Code:
find /path/to/dir -name "*.jpg" -print
finds all images in that directory and prints them
xargs executes "chmod 0644" for each image
__________________
1337 5y54|)m1n: 157717888
BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
Cambooth
darksoul is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote