LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 01-10-2005, 08:18 PM   #1
paul_mat
Member
 
Registered: Nov 2004
Location: Townsville, Australia
Distribution: Fedora Core 5, CentOS 4, RHEL 4
Posts: 855

Rep: Reputation: 30
chmod command to change all files in directory


i'm wondering if there is a chmod command to give access to all the files and subdirectories in a directory to all users?
 
Old 01-10-2005, 08:54 PM   #2
sharper
Member
 
Registered: Aug 2002
Location: MN USA
Distribution: slakware 9.0
Posts: 121

Rep: Reputation: 15
man chmod
-R Recusively change permissions of directories and their contents
 
Old 01-10-2005, 09:05 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Enable the 'other' bits for the directories and files.

chmod -R o+rwx <target directory>

This command will give all users full access. You might consider using rw access for files and not enabling the executable bit. You do need the executable bit enabled for directories. The 'x' bit is overloaded. For directories, it allows one to enter the directory.

You could do it this way:
find <target-directory> -type f -exec chmod o+rwx "{}" \;
find <target-directory> -type d -exec chmod o+rwx "{}" \;

If the directory is a partition with the fat32 filesystem, then you need to change the permissions in the /etc/fstab entry, by using the fmask and dmask options. For example 'fmask=001,dmask=000,noexec' will give read/write access to everyone, but not allow execution of files contained in the filesystem.
 
  


Reply


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
Using chmod to recursively change directories / files [GOD]Anck Linux - Software 6 11-10-2008 06:16 PM
Change directory command gizmobay Linux - Newbie 4 11-23-2005 06:11 PM
Why doesn't a wildcard chmod change "dot" files/directories? jht2k Linux - General 1 08-09-2004 02:31 PM
chmod command not affecting files blueleft Linux - General 4 08-09-2003 11:26 AM
RH 8.0 don't let me change attrib by chmod command explorer1979 Linux - General 2 10-27-2002 11:29 AM


All times are GMT -5. The time now is 06:07 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration