LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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