LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-02-2010, 12:37 PM   #1
gutterboy
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
AlucardZero
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
gutterboy
LQ Newbie
 
Registered: Sep 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks a lot!
 
  


Reply

Tags
chown, recursive



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:09 PM.

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