Results 1 to 5 of 5
-
07-06-2006, 08:12 PM #1Aspiring Evangelist
- Join Date
- Jan 2005
- Location
- WHT, where else?
- Posts
- 420
how to change ownership and group for a batch of files/directories?
I've untar-ed a .tar.gz file on my vps using a linux command line. But now the ownership and group of those files/directories need to changed. It would be very painful if changing them one by one, because I have many subdirectories and thousands of files under them. I was wondering if there is any commands such as chown out there I can use to change the ownership and group simultaneously?
appreciate your help.
thanks
IVYtony█ Tubenode.com - FFMPEG, PHP & RoR Hosting
█ RCholic.com - R/C videos sharing
-
07-06-2006, 08:53 PM #2Junior Guru
- Join Date
- Mar 2006
- Posts
- 209
You can run:
chown -R user:group directory
to change user and group ownership of the directory and all its files / subdirectoriesKnownHost Linux VPS Specialists
Toll Free: (866)-785-5479
www.knownhost.com sales@knownhost.com
New look & New plans!
-
07-06-2006, 08:56 PM #3ThirtySx Bits Forever!
- Join Date
- Jul 2001
- Location
- Canada
- Posts
- 1,284
If you have for example a directory called newfiles with files and subdirs to be changed to user john in the aliens group the following is what you would use:
chown -hR john:aliens newfiles/
the R means to recurse through files and subdirectories
the h means to only change ownership of symlinks, not the files/directories they point to
check out "man chown" or "info chown" at your shell prompt for further info."Obsolesence is just a lack of imagination."
-
07-06-2006, 09:03 PM #4Aspiring Evangelist
- Join Date
- Jan 2005
- Location
- WHT, where else?
- Posts
- 420
Originally Posted by NyteOwl
thank you guys so much!█ Tubenode.com - FFMPEG, PHP & RoR Hosting
█ RCholic.com - R/C videos sharing
-
07-06-2006, 09:09 PM #5Aspiring Evangelist
- Join Date
- Jan 2005
- Location
- WHT, where else?
- Posts
- 420
never mind. I tried this command to change the group:
chgrp -R ivytony directory
Thank you so much█ Tubenode.com - FFMPEG, PHP & RoR Hosting
█ RCholic.com - R/C videos sharing