[SOLVED] cannot remove 'test.bz2': Operation not permitted
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
$ ls -l ..
total 4
drwxrwxrwx 2 user user 4096 Mar 17 20:58 test
I have total right to the folder, so with everyone (bcos i have use chmod 777 before this)
Code:
$ sudo rm *.*
[sudo] password for user:
rm: cannot remove 'user.bz2': Operation not permitted
1) Why are you using the *.* instead of the file name?
2) What are (all) the permissions on the file. You showed us the directory, but not the file.
3) Have you tried my suggestion of using sudo with the file name?
4) This post you put in a file named user.bz2. Earlier the problem was with a file named test.bz2. Are you even in the same directory?
Using shell globbing with the *.* can be misleading on the problems reported, or it can do something unexpected if you are not careful. It is better to always, when possible, use the actual file name so you know exactly what you are asking the command to do.
1) Why are you using the *.* instead of the file name?
2) What are (all) the permissions on the file. You showed us the directory, but not the file.
3) Have you tried my suggestion of using sudo with the file name?
4) This post you put in a file named user.bz2. Earlier the problem was with a file named test.bz2. Are you even in the same directory?
Using shell globbing with the *.* can be misleading on the problems reported, or it can do something unexpected if you are not careful. It is better to always, when possible, use the actual file name so you know exactly what you are asking the command to do.
Code:
1) Why are you using the *.* instead of the file name?
Because i got 2 files that can't be remove.. both file are created by me some time ago when i was playing with tar command. I only show one of them..if i can do one, i can do both.
Code:
2) What are (all) the permissions on the file. You showed us the directory, but not the file.
Because someone in the forum wants to know if the parent folder of the file that i can't remove has got correct permission for me to delete it's content. In this case, i shows the parent folder has got permission for me to rwx.
Code:
3) Have you tried my suggestion of using sudo with the file name?
Yes, i have, i have even posted the output let me post it again.
A file with the 'i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file, most of the file's metadata can not be modified, and the file can not be opened in write mode. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
Yes, I should have posted sudo, but I thought that was assumed.
Yes, Thanks redd9.
I just finished read thru and digest the WHOLE lsattr and chattr.. and i recalled, i saw "i" in my previous post of lsattr. lol
It is such an easy thing.. lol But i spent so many hours to read and understand it.. + other thing i have to do while reading.. that's why it took me a whole day.. **crazy**
Thanks for helping.
Yes, I am a weird person.. i have to finish reading and understand the whole thing to solve a small issue.. kind of like making a butcher knife to cut a chicken..... a really lousy habit of learning thing.. That's why learning linux for me is really challenging.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.