Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-19-2005, 02:53 PM   #1
LQ Newbie
Registered: Jun 2003
Distribution: RH8
Posts: 9

Rep: Reputation: 0
CHMOD directories.sub-directories.files

I recently migrated a bunch of files from a windows partition to a linux partition; these all became ownership of root, allowing no other users to access to the files. Is there a way to CHMOD these directories, sub-directories, and files without having to go through every single folder and file? I'm looking at at least 500 folders with 10,000 files... surely there must be a more efficient way of doing this.

Does anyone know how? All the references I have read explain CHMOD only by giving examples with individual files. Thanks!
Old 11-19-2005, 03:16 PM   #2
Registered: Aug 2005
Location: Oregon
Distribution: Kubuntu.
Posts: 848

Rep: Reputation: 30
Here is three programs you can use:

Chmod # Changes file/folder permissions (as you already seem to know)
chown # Changes file/folder user ownership
chgrp # Changes file/folder group ownership

All three of these programs can use "-R" to change fils/folders recursively. Use "-f" to just do it without prompting or error warning.

So, to enable write permissions to a directory and everything below it, use:
chmod -Rf +w <dir>

To Change ownership:
chown -Rf <user> <directory

And to change group:
chgrp -Rf <group> <dir>

Hope this helps.
Old 11-19-2005, 03:22 PM   #3
LQ Newbie
Registered: Jun 2003
Distribution: RH8
Posts: 9

Original Poster
Rep: Reputation: 0
Smile Thanks!

Thank you so much, it worked on everything I had in only a few seconds.

Thanks again!

Last edited by zerojosh; 11-19-2005 at 03:32 PM.


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
[SOLVED] FTP: recursive chmod (separate for directories and files) mgmax Linux - Software 11 01-29-2011 08:06 AM
Using chmod to recursively change directories / files [GOD]Anck Linux - Software 6 11-10-2008 06:16 PM
Why doesn't a wildcard chmod change "dot" files/directories? jht2k Linux - General 1 08-09-2004 02:31 PM
Using chmod on directories rob19 Linux - Newbie 4 07-10-2004 04:37 AM
chmod directories and files seperately robeb Linux - General 2 05-23-2003 08:01 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:28 PM.

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