Tried with a few things I could think of without success. Ideas? Thanks.
Asked
Active
Viewed 574 times
-3
-
by mistake?? 777 already means anyone can modify the file already – danidee Apr 16 '15 at 03:19
-
Can you not delete it as root? Is not 777 just a random user ID? – WhiteMask Apr 16 '15 at 03:19
-
1@danidee OP said the `owner` is set to 777. – mjuarez Apr 16 '15 at 03:20
-
is 777 not a permisson for anyone on the system to read write and execute? – danidee Apr 16 '15 at 03:23
-
What "few things" did you think of? – SiKing Apr 16 '15 at 04:59
4 Answers
3
You should be able to delete the file if you run the remove command with sudo
sudo rm /path/to/file.txt

Andreas Gassmann
- 6,334
- 7
- 32
- 45
0
If it's your server, you can just sudo rm file
.

mjuarez
- 16,372
- 11
- 56
- 73
-
Please do **not** do -rf in this situation. It will not help you and it could be a disaster. – DWright Apr 16 '15 at 03:34
-
The reason it could be a disaster is that if the file is a linke to a folder structure and you aren't aware of it, it will do a recursive delete. You don't want to do `-rf` unless you explicitly want to recursively delete something. – DWright Apr 16 '15 at 04:17
0
thanks to everyone. The answer is when all attempts to change owner of the file fail, check the owner of its parent directory :).

Yvonne
- 153
- 1
- 1
- 3
-2
rm -rf filename
if you have the permission do delete the file
Otherwise:
sudo chown user filename && rm -rf filename
where user
is your username.

Amin Shah Gilani
- 8,675
- 5
- 37
- 79
-
Please do not do -rf in this situation. It will not help you and it could be a disaster. – DWright Apr 16 '15 at 04:12
-
The reason it could be a disaster is that if the file is a linke to a folder structure and you aren't aware of it, it will do a recursive delete. You don't want to do `-rf` unless you explicitly want to recursively delete something. – DWright Apr 16 '15 at 04:17