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

This is on a Debian box:

[ampeg]$ ls -la
total 36
dr-xr-xr-x 3 matt pg104272  4096 2011-01-27 10:37 .
drwxr-xr-x 3 matt pg104272  4096 2012-01-04 12:05 ..
-rwxrwxrwx 1 matt pg104272 11290 2012-01-02 06:41 default.settings.php
drwxrwxrwx 2 matt pg104272  4096 2012-01-04 11:56 files
-rwxrwxrwx 1 matt pg104272 10389 2011-01-27 10:34 settings.php
[ampeg]$ rm settings.php
rm: cannot remove `settings.php': Permission denied

I'm logged on as that matt user.

How is it possible that I can't delete that file?

share|improve this question
sudo rm settings.php – kobaltz Jan 4 '12 at 20:18
You can try using lsattr on that file. – XXL Jan 4 '12 at 20:22
i dont have root access on that machine – clamp Jan 4 '12 at 20:24
[ampeg]$ lsattr settings.php ------------------- settings.php – clamp Jan 4 '12 at 20:24
@clamp: wooh, then i dunno.. read-only filesystem? – XXL Jan 4 '12 at 20:28
up vote 14 down vote accepted

You have no write access on that directory.

dr-xr-xr-x 3 matt pg104272  4096 2011-01-27 10:37 .

You can't delete a file within a directory you don't have write access to. Moreover, quoting the Ubuntu Community manual, "write access for a directory allows deleting of files in the directory even if the user does not have write permissions for the file".

Obtain write privileges, then you're good to go.

share|improve this answer
damn, slhck is absolutely correct, lol.. – XXL Jan 4 '12 at 21:17

You must log in to answer this question.

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