Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SOLVED File will not delete either as user or root in home
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
roytheman
Tux's lil' helper
Tux's lil' helper


Joined: 08 Nov 2009
Posts: 102

PostPosted: Sat Mar 19, 2016 9:32 pm    Post subject: SOLVED File will not delete either as user or root in home Reply with quote

Hello Gentoo forum,

I have a .txt file (not a folder) in my home directory that will not delete as user or root using the "rm" command, but other files in that same directory will delete with no problem. The error says "operation not permitted".

ls -l gives me this:

Code:

-rw-r--r-- 1 royroy royroy


and lsattr gives me this:

Code:

----i----------- /home/royroy


I've Googled for an answer but there are many reasons for this so I decided to post here.

Help will be appreciated,
Roy


Last edited by roytheman on Sat Mar 19, 2016 11:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Sat Mar 19, 2016 10:36 pm    Post subject: Reply with quote

Quote:
and lsattr gives me this:

Code:

----i----------- /home/royroy
Pretty good reason to prevent you from deleting it. "i" flag protects the file, so it can't be modified. Remove the flag with the below command first:
chattr -i <filename>

Root ignores regular read/write permissions, but it does not ignore attributes.
Back to top
View user's profile Send private message
roytheman
Tux's lil' helper
Tux's lil' helper


Joined: 08 Nov 2009
Posts: 102

PostPosted: Sat Mar 19, 2016 11:52 pm    Post subject: Reply with quote

Thanks szatox, that solved it.

It makes me wonder how it ever happened in the first place. I did not knowingly do that.

Thanks again,
Roy
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum