LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-11-2010, 01:16 AM   #1
UNI
LQ Newbie
 
Registered: May 2008
Posts: 14

Rep: Reputation: 0
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
 
Old 12-11-2010, 02:19 AM   #2
JoshyJ
Member
 
Registered: Nov 2003
Location: Sydney , Australia
Distribution: Fedora
Posts: 49

Rep: Reputation: 1
Sounds like a homework question.
 
Old 12-11-2010, 08:22 AM   #3
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Rep: Reputation: 69
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
Code:
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
Code:
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
Code:
chmod u+w filename
If you are part of the group, then contact the owner to have him add the 'w' permission for you.
 
Old 12-11-2010, 08:47 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

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


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
Read/write permission to ALL users on a directory and everything in it Virtuality Linux - Newbie 3 12-13-2007 09:29 PM
chmod can not change permission lovelylinux Linux - Software 5 09-20-2007 06:22 AM
Cannot write to /misc directory - permission denied as root etuhs Fedora 4 06-01-2007 08:20 AM
chmod, external usb, vfat - can't chmod a directory itsjustme Slackware 2 04-02-2006 05:23 PM
Sharing a directory with a regular user (with write permission) Ironica Linux - Newbie 6 05-31-2004 12:27 PM


All times are GMT -5. The time now is 02:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration