-   Linux - Newbie (
-   -   chmod directory write permission (

UNI 12-11-2010 12:16 AM

chmod directory write permission
I have a directory that needs write permission to a specific file.
What would be the proper chmod syntax to do so
Lets say the folder I want to have writer permissions is "joe"
and the file that the joe folder needs to write to is "homework.conf"

current user

JoshyJ 12-11-2010 01:19 AM

Sounds like a homework question.

trist007 12-11-2010 07:22 AM

To the OriginaL Poster:

I'm assuming that you are either the owner or a member of the group for that directory. To see who the owner and the group is for that directory, cd into the directory that holds that directory and do a

ls -l directory
You will be able to see the owner and group of that directory. Ok so assuming that one of the above is true, you just need to make sure that if you're the owner, that you have write permissions to that file. So cd into that directory and do a

ls -l directory
When you do that you will see a list of permissions like so
rwxrwxrwx, some will be blank '-' meaning that that permission is not turned on.
The first set of rwx is for the user, the second for the group and the third for everybody else.

So if you are the owner make sure that you have a 'w' in the first set of permissions. If you are in the group then make sure you have a 'w' in the 2nd set of permissions. If you are not part of the group and are not the owner then you need a 'w' on the 3rd set of permissions.

To be able to set permissions on a file you need to be the owner of that file. So let's say you are the owner of the file and the first set of permissions is missing the 'w' then do a

chmod u+w filename
If you are part of the group, then contact the owner to have him add the 'w' permission for you.

catkin 12-11-2010 07:47 AM

Typos: the first ls -l directory should be ls -ld directory and the second should be ls -l

All times are GMT -5. The time now is 09:59 PM.