Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 12-02-2010, 12:37 PM   #1
LQ Newbie
Registered: Sep 2010
Posts: 16

Rep: Reputation: 0
Recursive chown folders & not files

Hey guys..... I know you can do a recursive chown on EVERYTHING like this..

chown -R username:group somedir

But what I want to do is the same, but only make it affect folders & NOT files.

Can this be done?

Thanks a lot!
Old 12-02-2010, 12:50 PM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Yes, by combining find and chown.

find /top/path/here -type d -exec chown username:group '{}' \;

see: man find
Old 12-02-2010, 01:10 PM   #3
LQ Newbie
Registered: Sep 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks a lot!


chown, recursive

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
Way to test permissions on all files/folders into a folder recursive? frenchn00b Programming 1 05-16-2010 04:42 AM
bash script to create folders including making recursive folders.... linux-bandit Linux - Software 8 11-28-2009 01:50 AM
how to chown/chmod/touch thru all files/folders in /home/* ?? linus72 Linux - General 10 08-15-2009 01:26 PM
Sync files not folders with rsync (non recursive) ehlers Linux - Software 7 03-11-2009 09:53 AM
How to chown entire folders and files and subs? natbrazil Linux - Newbie 7 04-13-2008 11:22 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:27 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