Networking Forums

Networking Forums > Computer Networking > Linux Networking > File permissions

Reply
Thread Tools Display Modes

File permissions

 
 
gdf1903@hotmail.com
Guest
Posts: n/a

 
      09-12-2006, 03:59 PM
Hi all,

I'm pretty new to Linux and looking for some help with file
permissions.

I have a folder called Folder1. Folder1 has other folders and files
inside it.

I'd like to amend the permissions for Folder1 and everything inside it
so that everyone has read/write access.

Is it possible to do this with one command?

Thanks for any help.

 
Reply With Quote
 
 
 
 
Ali Al-Shabibi
Guest
Posts: n/a

 
      09-12-2006, 04:21 PM
Hi,

Permissions are different for folder and files...

* read determines if a user can view the directory's contents,
i.e. do ls in it.
* write determines if a user can create new files or delete
file in the directory. (Note here that this essentially means
that a user with write access toa directory can delete files in
the directory even if he/she doesn't have write permissions for
the file! So be careful with this.)
* execute determines if the user can cd into the directory.

and for files it's as the permissions state.

The command you are looking for is:

chmod -R +rw <dir_name>

Cheers,

Ali


(E-Mail Removed) wrote:
> Hi all,
>
> I'm pretty new to Linux and looking for some help with file
> permissions.
>
> I have a folder called Folder1. Folder1 has other folders and files
> inside it.
>
> I'd like to amend the permissions for Folder1 and everything inside it
> so that everyone has read/write access.
>
> Is it possible to do this with one command?
>
> Thanks for any help.
>

 
Reply With Quote
 
Floyd L. Davidson
Guest
Posts: n/a

 
      09-12-2006, 04:42 PM
(E-Mail Removed) wrote:
>Hi all,
>
>I'm pretty new to Linux and looking for some help with file
>permissions.


Great! The first thing you need to know about is *RTFM*. (and
despite rumors, the "F" is not "Fine"...)

It would actually be a good idea to spend a few hours looking at
the man pages for virtually everything that is in /bin and
/sbin, just to find out what can be done. You don't need to
remember details, but it's nice to have some idea where to
start.

For example, the answers to your questions are relatively easy
to get by simply reading the man pages for "chmod" and "find".

>I have a folder called Folder1. Folder1 has other folders and files
>inside it.


Actually what you have is a _directory_ named "Folder1", which
contains other directories as well as files.

>I'd like to amend the permissions for Folder1 and everything inside it
>so that everyone has read/write access.
>
>Is it possible to do this with one command?


Easy.

chmod -R 777 /path_to/Folder1

No that you necessarily want to do it the easy way though! That
also makes every file executable, which you probably don't want.
But you do want that bit set for all of the directories (on
directories the execute bit allows access).

So the question then becomes how to distinguish between files
and directories as things get changed. The /find/ program makes
that almost easy.

First, set permissions as needed on all of the directories and
sub-directories,

find /path_to/Folder1 -type d -exec chmod 777 {} \;

Then change all of the files to the desired permissions,

find /path_to/Folder1 -type f -exec chmod 666 {} \;

*Do* read at leasst the man pages for both /chmod/ and for
/find/ before doing that.

--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
David M
Guest
Posts: n/a

 
      09-13-2006, 12:34 AM
On Tue, 12 Sep 2006 08:59:51 -0700, gdf1903 rearranged some electrons to
form:

> Hi all,
>
> I'm pretty new to Linux and looking for some help with file
> permissions.
>
> I have a folder called Folder1. Folder1 has other folders and files
> inside it.
>
> I'd like to amend the permissions for Folder1 and everything inside it
> so that everyone has read/write access.
>
> Is it possible to do this with one command?
>
> Thanks for any help.


man chmod

--
David M (dmacchiarolo)
http://home.triad.rr.com/redsled
T/S 53
sled351 Linux 2.4.18-14 has been up 13 days 2:34

 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      09-13-2006, 02:23 AM

(E-Mail Removed) wrote:
> Hi all,
>
> I'm pretty new to Linux and looking for some help with file
> permissions.
>
> I have a folder called Folder1. Folder1 has other folders and files
> inside it.
>
> I'd like to amend the permissions for Folder1 and everything inside it
> so that everyone has read/write access.
>
> Is it possible to do this with one command?
>
> Thanks for any help.


Nobody got it right. What you want is most likely:

chmod -R a+rwX Folder1

DS

 
Reply With Quote
 
gdf1903@hotmail.com
Guest
Posts: n/a

 
      09-13-2006, 01:28 PM
Thanks for everyones help. I think the one from David was what I
needed, seemed to work as expected anyway! Thanks again.

 
Reply With Quote
 
Lee Sau Dan
Guest
Posts: n/a

 
      09-19-2006, 01:14 PM
>>>>> "Floyd" == Floyd L Davidson <(E-Mail Removed)> writes:


Floyd> (E-Mail Removed) wrote:
>> Hi all,
>>
>> I'm pretty new to Linux and looking for some help with file
>> permissions.


Floyd> Great! The first thing you need to know about is *RTFM*.
Floyd> (and despite rumors, the "F" is not "Fine"...)
...
(see far down below)



>> I'd like to amend the permissions for Folder1 and everything
>> inside it so that everyone has read/write access.
>>
>> Is it possible to do this with one command?


Floyd> Easy.

Floyd> chmod -R 777 /path_to/Folder1

Floyd> No that you necessarily want to do it the easy way though!
Floyd> That also makes every file executable, which you probably
Floyd> don't want. But you do want that bit set for all of the
Floyd> directories (on directories the execute bit allows access).

In that case, you should have recommended the following instead:

chmod -R a+-rwX /path_to/Folder1

Note the uppercase "X".

Learn to use symbolic permission specifiers. They're easier to
memorize and more versatile than the numeric octal codes. esp. for
people who aren't that good with numbers, let alone octal arithmetics.


Floyd> So the question then becomes how to distinguish between
Floyd> files and directories as things get changed. The /find/
Floyd> program makes that almost easy.

What an overkill! "chmod" can do that with the permission specifier
"X". Have you read the man page yourself?


--
Lee Sau Dan +Z05biGVm- +AH4-{@nJX6X+AH4-}

E-mail: (E-Mail Removed)
Home page: http://www.informatik.uni-freiburg.de/+AH4-danlee
 
Reply With Quote
 
Floyd L. Davidson
Guest
Posts: n/a

 
      09-19-2006, 02:22 PM
Lee Sau Dan <(E-Mail Removed)> wrote:
>>>>>> "Floyd" == Floyd L Davidson <(E-Mail Removed)> writes:

>
> Floyd> (E-Mail Removed) wrote:
> >> Hi all,
> >>
> >> I'm pretty new to Linux and looking for some help with file
> >> permissions.

>
> Floyd> Great! The first thing you need to know about is *RTFM*.
> Floyd> (and despite rumors, the "F" is not "Fine"...)
> ...
>(see far down below)


And note what I said it means!

> Floyd> chmod -R 777 /path_to/Folder1
>
> Floyd> No that you necessarily want to do it the easy way though!
> Floyd> That also makes every file executable, which you probably
> Floyd> don't want. But you do want that bit set for all of the
> Floyd> directories (on directories the execute bit allows access).
>
>In that case, you should have recommended the following instead:


You don't read well Lee. The above is *not* a recommendation. It is
an example to demonstrate something, which is an invitation to read the
man pages to learn *exactly* which options etc would be appropriate.

> chmod -R a+-rwX /path_to/Folder1
>
>Note the uppercase "X".
>
>Learn to use symbolic permission specifiers. They're easier to
>memorize and more versatile than the numeric octal codes. esp. for
>people who aren't that good with numbers, let alone octal arithmetics.


That may well be true, but since you are trying to accomplish
something entirely different than I was, there actually was a
good reason for not mentioning that in my post.

> Floyd> So the question then becomes how to distinguish between
> Floyd> files and directories as things get changed. The /find/
> Floyd> program makes that almost easy.
>
>What an overkill! "chmod" can do that with the permission specifier
>"X". Have you read the man page yourself?


Not overkill; just a much more versatile way. If you carefully
read the man page, you will see that your command line does not
do the same thing that I am suggesting can be done. A subtle
difference, but it just depends on what the intended results
are.

--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
correct file permissions? Steve Newman Windows Networking 0 04-05-2006 03:25 PM
file permissions incorrect Joe Windows Networking 1 09-14-2005 05:09 PM
File permissions with w/networking Eddie Gee Wireless Networks 1 08-16-2005 12:48 PM
Serious file permissions help Joe Windows Networking 2 05-04-2004 05:07 PM
XP Pro permissions and file sharing Hardeep Rakhra Home Networking 4 12-23-2003 01:44 PM



1 2 3 4 5 6 7 8 9 10 11