chmod and chown recursion (sudo)

Thufir Hawat hawat.thufir at gmail.com
Sat Mar 5 13:55:17 UTC 2011


On Sat, 05 Mar 2011 06:06:37 -0700, Smoot Carl-Mitchell wrote:

> On Sat, 2011-03-05 at 09:14 +0000, Thufir Hawat wrote:
>> How do you recursively change the owner and add read/write permissions?
>> For some reason, http://apress.com/book/downloadfile/4045 seems to have
>> odd permissions?  From time to time I seem to run across downloads like
>> this :(
>> 
>> Using chown recursively worked fine, but running, via sudo:
>> 
>> chmod +rw FaceletsEssentials/  -Rv
>> 
>> didn't actually add read and write permissions (I suppose I really on
>> need read).  Is there some trick to "forcing" this command to work as
>> sudo?
> 
> The umask bits are modifying the results when you do not specify the
> leading ugo flags.  I suspect root's umask is different than your own
> umask.  See the man page for details.  This should work if you really
> want to make the file tree readable and writable by everyone:
> 
> sudo chmod -R ugo+rw  FaceletsEssentials

I'll check the doc's, thanks.  I'm not familiar with umask.  Here are the 
results of that command, which doesn't quite accomplish what I'd hoped 
for:

thufir at tleilax:~/Desktop$ 
thufir at tleilax:~/Desktop$ sudo chmod -R ugo+rw  facelet/
thufir at tleilax:~/Desktop$ 
thufir at tleilax:~/Desktop$ sudo ls facelet/FaceletsEssentials/
creatingAnApp/src/main/java/com/apress/myfaces/BirdFunctions.java
facelet/FaceletsEssentials/creatingAnApp/src/main/java/com/apress/myfaces/
BirdFunctions.java
thufir at tleilax:~/Desktop$ 
thufir at tleilax:~/Desktop$ ls facelet/FaceletsEssentials/creatingAnApp/src/
main/java/com/apress/myfaces/BirdFunctions.java
ls: cannot access facelet/FaceletsEssentials/creatingAnApp/src/main/java/
com/apress/myfaces/BirdFunctions.java: Permission denied
thufir at tleilax:~/Desktop$ 



thanks,

Thufir





More information about the ubuntu-users mailing list