Friday, August 19, 2011

Unable to delete a file in linux

On a fine day, I found a normal looking file, which I just wanted to clean.

$ ls -l var/t/log/tlog
-rwxrwxrwx 1 root root 2770 Apr 6 14:05 var/t/log/tlog
$ sudo rm -rf var/t/log/tlog
rm: cannot remove `var/t/log/tlog': Operation not permitted
$ sudo rm -rf var/t/log
rm: cannot remove `var/t/log/tlog': Operation not permitted
$ sudo getfacl var/t/log/tlog
# file: var/t/log/tlog
# owner: root
# group: root
user::rwx
group::rwx
other::rwx

then why the hello even if I am root, I cannot delete the file.

#cd var/t/log
# lsattr tlog
-----a------- tlog
# chattr -a tlog
# lsattr tlog
------------- tlog
# rm -rf yinstlog

Done.


No comments:

VIM issues with powerline

What to do if you get this annoying issue - vi requirements.txt ...