"chmod -R 644 *.jpg *.gif *.htm" doesn't work
because chmod look for jpg, gif and htm files
under the current directory. since they are
all files (not directories) the "-R" switch
is simply ignored.
"chmod -R 644 website/ *.jpg" doesn't work because
chmod will first recursively change everything
under website/ to 644, even including subdirectories
-- most likely not what you want.
according to the man page, the "-f" switch is
for suppressing error messages. don't think
that'll help either.
so here my suggestion:
. copy the following lines to a file under backup/
and name it chmod.sh
#!/bin/bash
files=`find website | egrep "jpg|gif|htm"`
for i in $files; do
chmod 644 $i
done
. chmod 700 chmod.sh
. ./chmod.sh
- steve
--- Adrian Smith <[EMAIL PROTECTED]> wrote:
> here is a question for you folks. i have a
> directory with subdirectories which contains my web
> site. it is /backup/website and files &
> subdirectories exist under that. when i cd to
> /backup/website and run
>
> chmod -R 644 *.jpg *.gif *.htm
>
> it will not work on the contents of the
> subdirectories. i have also tried
>
> chmod 644 -R *.jpg *.gif *.htm
> and
> chmod 644 *.jpg *.gif *.htm -R
> and
> I have tried these as root. as user i do have
> access & permission to all files and directories
> under /backup/website and my user account is the
> owner. anyone know why the -R doesn't work with
> chmod?
>
>
>
> Adrian Smith
> 'de telepone dude
> Telecom Dept.
> x 7042
> [EMAIL PROTECTED]
>
>
>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/