Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26th December 2004, 09:55 PM
elian85 Offline
Registered User
 
Join Date: Nov 2004
Posts: 10
change folder owner(many folders/files)

i used to work as root for a while and saved many files in the home directory of a user. now i need to have full access to these files.

i can look each file up if it belongs to the root or to the normal user. but its more then 300gb. is there a command which changes the owner of the directory and all subdirectories and all files in these directories??

ty
Reply With Quote
  #2  
Old 26th December 2004, 10:18 PM
terr9898 Offline
Registered User
 
Join Date: Dec 2004
Posts: 194
You can use the 'chown -R user:group *' to recursively change the files and directory to the user:group.

Use 'man chown' for more details.
Reply With Quote
  #3  
Old 27th December 2004, 12:42 AM
crackers's Avatar
crackers Offline
Retired Community Manager
 
Join Date: Feb 2004
Location: Seattle, WA, USA
Age: 56
Posts: 3,423
The safest way to do this is to (as root) use chown -R username:group /home/username where the user's home directory is the same name as the user. Just using "*" while you're in /home/username will miss a lot of important "hidden" files (filename starts with .) and the home directory itself (/home/username). And, if you happen to be in the wrong directory, can really mess up your system if you accidentally change the ownership of system files.
__________________
Linux User #28251 (April '93)
Professional Java Geek :cool:

Last edited by crackers; 27th December 2004 at 12:44 AM.
Reply With Quote
  #4  
Old 27th December 2004, 12:55 AM
kosmosik's Avatar
kosmosik Offline
Registered User
 
Join Date: Apr 2004
Location: Warsaw, Poland
Age: 32
Posts: 1,085
try using find with xargs...
Code:
$ find -user username /home/otherusername | xargs chown otherusername:othergroup
Reply With Quote
  #5  
Old 27th December 2004, 12:59 AM
kosmosik's Avatar
kosmosik Offline
Registered User
 
Join Date: Apr 2004
Location: Warsaw, Poland
Age: 32
Posts: 1,085
oh and as of size - it does not matter that it is 300gb, such process can be slower with 300kb of files it just depends how many of this files system will have to process (it does not modify the files itself, it modifies theirs attributes only).
Reply With Quote
  #6  
Old 28th December 2004, 07:24 PM
elian85 Offline
Registered User
 
Join Date: Nov 2004
Posts: 10
thx for help, worked fine

thx for your help. though i didnt understand ur descriptions at first, i was able to look it up in my oreilly book. it is quite hard for a linux noob^^.

for those who might be interested in this and know as little about linux as i do i ll sum up was important for me:

the command:
$ chown bitbjoern blub
assigns the folder blub to the user bitbjoern. i was locked in as root cuz the folders belonged to root.
$ chown -R bitbjoern blub
assigns the folder blub, all subfolders and all files included to the user bitbjoern.

so.... i used
$ cd /home
$ chown -R bitbjoern bitbjoern
i transfered the ownership off all files in the home directiory "bitbjoern" to the user "bitbjoern". i guess i could ve used
$ chown -R bitbjoern /home/bitbjoern
as well but i didnt want to test it.


thx a lot for helping me. big and fast help. and it took 2 seconds(6237 items 380,9gb)^^.
Reply With Quote
Reply

Tags
change, folder, folders or files, ownermany

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change access rights to folders & files jaisol Security and Privacy 12 24th February 2009 05:50 AM
Changing owner and rights on /proc folder!? help zagi81 Using Fedora 0 5th October 2008 12:33 PM
My root folder' owner and group are named! mikezang Using Fedora 0 5th November 2005 05:36 AM


Current GMT-time: 11:28 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat