Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-14-2008, 12:01 PM   #1
LQ Newbie
Registered: Aug 2003
Posts: 17

Rep: Reputation: 0
How to chown entire folders and files and subs?

Hi all,

Could someone please help with an example of how to change ownership of an entire folder, its files and its subfolders (and files)?

I can only find simple file examples, not what I need.

I usually use WebMin, but I can't figure out how to make WebMin's File Manager change the owners without changing the permissions as well.
(So if anyone knows how to do this via WebMin, that would be greatly appreciated as well)

Old 03-14-2008, 12:04 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
chown -R owner:group /dirname (recursive chown)
Old 03-14-2008, 02:25 PM   #3
LQ Newbie
Registered: Aug 2003
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks Very Much!
Old 03-14-2008, 09:35 PM   #4
LQ Newbie
Registered: Mar 2008
Distribution: 5 servers all Redhat; Kubuntu and Debian on Desktops
Posts: 1

Rep: Reputation: 0
Thanx from me also.

Originally Posted by bigrigdriver View Post
chown -R owner:group /dirname (recursive chown)
WOW, talk about service...

I just joined/logged-in/searched and the answer was already here.

Thanx Again
Old 04-13-2008, 12:24 AM   #5
LQ Newbie
Registered: Mar 2007
Posts: 5

Rep: Reputation: 0
That "-R" is great for changing the next level down, but how about multi-levels? I've gotta chown (or chmod.. I don't know if either would work) my .mozilla dir, so that's maybe five levels if I wanna take half the night chasing down subfolders, but I'd rather learn a better way for the next time I need it!
Old 04-13-2008, 02:18 AM   #6
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Rep: Reputation: 30
It goes as deep as your directory structure cares to go.
Old 04-13-2008, 07:56 AM   #7
Registered: Oct 2005
Distribution: Ubuntu 12.04 X86_64
Posts: 960

Rep: Reputation: 35
-R on many simple comandse is recursive, it goes as deep as its possable to go in that directory...

it wll work with mv, cp, chmod, chown, and rm, so allways check you are in the right place before running rm -r

(oh, in some its -R and some -r)
Old 04-13-2008, 11:22 PM   #8
LQ Newbie
Registered: Mar 2007
Posts: 5

Rep: Reputation: 0
Wink Thanks!

I got it. I had transferred some hidden files to a new machine. It didn't turn out to be an ownership question after all but permissions. The permissions got changed in the move. I found it and changed it back via the gui to get read & write privileges back.

Thanks again!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
chown, chgrp an entire directoy and contents gin1 Red Hat 8 09-06-2013 02:48 AM
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
useing SCP to copy entire directories with sub folders? Lleb_KCir Linux - General 5 09-13-2005 09:08 PM
chmod/chown and folders :) chibi Linux - Newbie 2 04-28-2005 04:56 PM
chmod vs chown on some root files and yes apps ergo_sum Linux - Newbie 3 11-12-2003 10:49 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration