LinuxQuestions.org
Review your favorite Linux distribution.
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 12-11-2010, 12: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, 01: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, 07:22 AM   #3
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 70
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, 07:47 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

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


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

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

All times are GMT -5. The time now is 08:12 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
Open Source Consulting | Domain Registration