LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-19-2021, 04:01 PM   #16
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484

Quote:
Originally Posted by andrewysk View Post
Code:
$ 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.
 
Old 03-19-2021, 04:03 PM   #17
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: RHEL, Ubuntu
Posts: 212
Blog Entries: 1

Rep: Reputation: 82
Code:
chattr -i user.bz2
rm user.bz2
 
1 members found this post helpful.
Old 03-20-2021, 06:10 AM   #18
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by computersavvy View Post
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.
Code:
$ sudo rm *.*
rm: cannot remove 'user.bz2': Operation not permitted
Code:
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?
Yes, they are in the same directory.
 
Old 03-20-2021, 09:21 AM   #19
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by redd9 View Post
Code:
chattr -i user.bz2
rm user.bz2
Code:
$ chattr -i user.bz2
chattr: Operation not permitted while setting flags on user.bz2
 
Old 03-20-2021, 10:59 AM   #20
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Sigh. Please read again the chattr manual page, specifically this part:
Quote:
i
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.

Last edited by shruggy; 03-20-2021 at 11:06 AM.
 
1 members found this post helpful.
Old 03-20-2021, 11:00 AM   #21
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: RHEL, Ubuntu
Posts: 212
Blog Entries: 1

Rep: Reputation: 82
Yes, I should have posted sudo, but I thought that was assumed.
 
Old 03-20-2021, 01:43 PM   #22
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by redd9 View Post
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.
 
Old 03-20-2021, 01:46 PM   #23
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: RHEL, Ubuntu
Posts: 212
Blog Entries: 1

Rep: Reputation: 82
Great, glad to hear it worked.

If your thread is solved, please click 'YES' on my post and mark it as solved.
 
Old 03-20-2021, 01:48 PM   #24
andrewysk
Member
 
Registered: Mar 2020
Posts: 797

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
Sigh. Please read again the chattr manual page, specifically this part:
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.
 
  


Reply

Tags
terminal



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] rmdir:failed to remove 'aaa':Operation not permitted mcmxciv Linux - Newbie 3 12-04-2017 06:25 AM
SIOCSIFFLAGS: Operation not permitted SIOCSIFFLAGS: Operation not permitted sushan1982 Linux - Wireless Networking 1 01-01-2012 08:04 PM
[SOLVED] Cannot remove file - "Operation not permitted" ffallateuf Linux - Server 6 10-04-2010 03:19 PM
OpenVPN: Cannot ioctl TUNSETIFF tun: Operation not permitted? licht Linux - Networking 3 07-29-2007 07:38 AM
rm: cannot remove 'filename.extension' Operation not permitted shinystuffrox Linux - Software 8 03-07-2007 05:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration