Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I find myself in a strange situation where a script wrote files with the following permissions:

-r-------- 1 user1 user1 file1 Dec 24 14:53
-r-------- 1 user1 user1 file2 Dec 24 14:54
-r-------- 1 user1 user1 file3 Dec 24 14:55

How do I remove these files? I can't change the permissions of the files with chmod [neither with 'user1' nor as sudo/root].

[If it makes any difference, I am running ubuntu]

share|improve this question
    
Can you change the owner using chown username file? –  Pazis Dec 24 '13 at 14:12
    
@Pazis No, I don't have permissions for that! It's a recursive problem :( –  Dhara Dec 24 '13 at 14:16
    
I cannot see the problem: I can easily chmod my files, even when their permissions are just 400. And I can delete them. Your problem is elsewhere (disk mount, perhaps?). –  MariusMatutiae Dec 24 '13 at 16:11
    
@MariusMatutiae - In your computer you will be the owner of the files so you won't find any problem in your system. –  vishram0709 Dec 24 '13 at 17:01
    
Right. Are you telling me you are trying to erase someone else's files? –  MariusMatutiae Dec 24 '13 at 17:01

1 Answer 1

Removing a file means changing the directory containing them. The file's permissions (and its ownership, for that matter) are inconsequential.

So, if you have write permissions to the containing directory, a simple rm should work.

If you do not, you will have to chmod +w . first.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.