chmod and chown recursion (sudo)

Smoot Carl-Mitchell smoot at tic.com
Sat Mar 5 17:54:34 UTC 2011


On Sat, 2011-03-05 at 13:55 +0000, Thufir Hawat wrote:

> 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$

Since it looks like the tree is on your desktop, it should be owned by
you.  If you unpack a tar file with sudo the ownerships of the files
will be set to whatever is set in the tar archive.  To fix you problem,
I'd just change the ownerships to yourself or just untar the tree
without using sudo.    To change the ownership of the tree do:

sudo chown -R thufir facelet

-- 
Smoot Carl-Mitchell
System/Network Architect
voice: +1 480 922-7313
cell: +1 602 421-9005
smoot at tic.com





More information about the ubuntu-users mailing list