AIXThis forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"find . -type f -print | xargs chmod 444 "shoud work, isn't it ?
If not, find . -print >myfile.sh
and vi myfile.sh removing the directories (they should not be soo many), and then
1,$s/^/chmod 444/
and sh myfile.sh.
I know, the vi way is not very clever, but it works without thinking more than two seconds, so why not ?
I'm not sure if it's available everywhere, but on some versions of find at least you can replace the final semicolon with a plus sign, in which case it will act in a way similar to xargs. That is, it will run only one or a few instances of the command, with all the files from find built into a single argument.
I couldn't find anything that definitively showed that aix find has it, but this generic "unix" man page lists it as an option. gnu find also has it, of course.
(What the heck? I just noticed that this thread is over 6 years old!)
Last edited by David the H.; 09-16-2010 at 10:21 AM.
Reason: zombie thread!
So I went trawling the web for an elegant and simple solution to this and decided to write a little script for this myself.
It basically does the recursive chmod but also provides a bit of flexibility for command line options (sets directory and/or file permissions, or exclude both it automatically resets everything to 755-644). It also checks for a few error scenarios.
yah...ok...lets shoot self in foot here....UH people... Dont let my 15 year old AS degree bite you in the ass here! LEAST PERMISSIVE.
THIS IS LINUX for GODS SAKES! You REALLY want the UNIVERSE to READ, or WORSE your FILES? The fact that some server services REQUIRE ANYTHING other than 0 for the world bit is MIND BLOWING! If the service(is and should be) a part of the GROUP you are assigned to(in any way) then SHURELY the process already HAS the necessary permission to read or exec the files, IE: apache.
Yet apache wants at minimal read permissions here? I think something is askew somewhere in someone's logic. Your theory holds. Your implementation of it SUCKS! 640 for files, 750 for folders(must exec or cannot browse them) is the CORRECT permissions.
Obviously, with apache, the last bit must be 4 for some reason, even though you are USUALLY a part of the www group when setting it up.And Im also finding that one must own files as root to put them into www folder to begin with.They should only need www as a group set.Neither the world bit nor the files should be owned by root to get apache to work with them.THIS IS NOT the CASE, however.
Completely missed the boat.Next cruise sails in 30 minutes...
need to edit certain files only? (commmand hell....) try this:
find . -name "*php" -exec chmod 644 '{}' \; -print
Last edited by jazman334; 02-14-2016 at 12:29 AM.
Reason: incomplete
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.