Jump to content
Sign in to follow this  

Can't delete a file?

Recommended Posts

I couldn't find an answer to this on these boards last night, but I found an answer to this elsewhere. I thought I would just post it up here to improve the knowledge database for other useless newbies like me.


I was messing around with installing DSL (Damn Small Linux) on a USB thumb drive and created a file in a directory in my /mnt/ directory that I couldn't delete even as root.


I'm a newbie so I tried going into single user mode and other things but couldn't delete the blasted thing chmod wouldn't let me change to write permissions the permissions were as follows:


-r--r--r-- 1 root root


The quick answer is to do this, (replace the filename below with the name of the file you can't delete), remember to be logged in as root:


lsattr filename


If you see an "i" in the attributes listed then that's whats stopping you from deleting the file.


so do this

chattr -i filename


then delete the file per usual.


[moved from Terminal Shell Commands, etc by spinynorman]

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...