Wednesday, October 6, 2010

Teething And Rash On Legs

Permissions

many times to install something on our web server and we have to give permission to all directories eg. 755 and 644 files .... the pucha which is very tedious to enter each directory and run chmod.
And making a shell script that goes into each and what to do?
well, that option is valid as well but if we add or remove any directory no longer serves the script and not have to re-edit it etc.. Here

leave some commands that combine find and chmod

and are quite useful for what I'm talking about, certainly more than one will thank me. Lucky



# Find directories (-type d) in the current directory (.) And give them access


755
> find
.

-type d-exec


chmod 755 {


} \\;



# Find files (-type f) in the current directory (.) And give them access

644

> find
.



chmod 644 {
} \\;



# Find files (-type f) html (-name '*. htm *') in the subdirectory
web (. / site) and 644 them access
> find
. / web -type f -name '*. htm *'-exec chmod 644 {

} \\; # Find files / directories with permission 777 (-perm 777)
in the current directory (.) and provide access 755. The option-print delivery more information on the outcome find . -perm 777-exec
chmod 755 {
} \\;
-print

0 comments:

Post a Comment