LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-19-2005, 02:53 PM   #1
zerojosh
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
GrueMaster
Member
 
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
zerojosh
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:29 AM.

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