Consider the following scenario:
- I have
rwx
access to a directory as a member of the group id of the directory. - The system admin does not let users run
chown
(see this thread for details)
How can I take recursive ownership of the directory?
I believe I can do the following, assuming that I want to own A
cp -R A B
rm -R A
mv B A
but this is tedious and can require a large amount of space if A
is large.
mv
does not have any effect on the ownership but themkdir A
has. The new created directory will belong to the user – Ulrich Dangel Jul 30 '12 at 06:34find -type d
to do this recursively… But there's surely a better way. – Gilles 'SO- stop being evil' Aug 02 '12 at 16:44