Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Linux Group Permissions

I have a file with following permissions

$ ls -l setup.txt
-rwxrwxr-x 1 www-data www-data 10741 2011-10-12 14:15 setup.txt

I belong to www-data group

$ groups `whoami`
auniyal : auniyal adm dialout cdrom audio www-data plugdev lpadmin admin sambashare vboxusers

So I was thinking I should be able to write to that file but I am not

$ test -w setup.txt && echo "Writable" || echo "Not Writable"
Not Writable

so how is it determined that file is writable or not, because my thinking was if file is group writable and I belong to that group I should be able to write to that file?

and in case it helps directory is also group writable

$ ls -l ..
drwxrwxr-x 10 www-data www-data    4096 2011-12-07 09:42 timesite
share|improve this question

marked as duplicate by grawity, surfasb, Ƭᴇcʜιᴇ007, ChrisF, studiohack Dec 11 '11 at 15:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Did you recently add yourself to the www-data group? If so, have you logged out since? – Mat Dec 7 '11 at 16:37
@Mat yes that was it, you can put that as answer and I will select it, or I can close it as duplicate – Anurag Uniyal Dec 7 '11 at 16:38

I needed to log-out and log-in again as I just added myself to www-data group

Linux Group Permissions

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .