chown thru multiple directories
karron at MCIRPS2.MED.NYU.EDU
karron at MCIRPS2.MED.NYU.EDU
Sun Jul 8 08:31:51 AEST 1990
JORDAN%gmr.com at relay.cs.net asks about "chown thru multiple directories"
>Is there a command available that will change the owner and group
>of every file in the current directory, and every file & directory
>below the current directory?
>
>Or will I have to write my own shell program?
Do this one liner:
find /$startdir -exec chown $username "{}" \; -print
Rr to change both the user and the owner
find /$startdir -exec chgrp $usergrouop "{}" \; -exec chown $username "{}" \; -p
rint
the -print is optional. It justs shows you what find is finding.
Replace $startdir,$username,$usergroup with your actual value.
Tar also has setting that will unload an archives with the current users
ownership and group. Have to look that up. I always forget it when unloading
tar archives and then do the above to fix things. The real problem is when
you are unloading an archive with root permissions as a user with no
permissions. Then you can not chown and chgrp on the monster you have just
created. You are stuck until root can do it for you.
--
+-----------------------------------------------------------------------------+
| karron at nyu.edu Dan Karron |
| . . . . . . . . . . . . . . New York University Medical Center |
| 560 First Avenue \ \ Pager <1> (212) 397 9330 |
| New York, New York 10016 \**\ <2> 10896 <3> <your-number-here> |
| (212) 340 5210 \**\__________________________________________ |
+-----------------------------------------------------------------------------+
More information about the Comp.sys.sgi
mailing list