LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-14-2013, 05:05 AM   #1
as92
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Rep: Reputation: Disabled
What file types can the rm command not delete?


Hello everyone.
To complete my piece of work I need to name a type of file that cannot be deleted by the rm command. I've searched google monotonously but I can't seem to find an answer for it. Any help would be great, thanks!
 
Old 02-14-2013, 05:27 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi,

Welcome to the forum ... where we do not take the habit of helping out with your homework...but, since you're new here , and may not have read the rules yet, here's the man page on rm..

Thor
 
Old 02-14-2013, 05:31 AM   #3
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
You can't remove files that have already been removed. For instance if you "rm /dev/zero" twice you can watch what happens the 2nd time. (Don't try this on hosts you aren't prepared to fix if they break.)
 
1 members found this post helpful.
Old 02-14-2013, 05:45 AM   #4
as92
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Sorry and thank you!
 
Old 02-15-2013, 03:11 AM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Sorry and thank you!
DO NOT APOLOGISE!!! No need to. Asking a question (no matter how silly someone thinks it is) is what this place is about...No question is too silly to be asked here...believe me...I should know...

Did these answers help you? Do you need more input? Again: welcome here

Thor
 
Old 02-15-2013, 07:53 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
What about a file with the immutable bit set? Example:
Code:
# touch /tmp/file
# chattr +i /tmp/file
# lsattr /tmp/file
----i--------e- /tmp/file
# rm /tmp/file
rm: remove regular empty file `/tmp/file'? y
rm: cannot remove `/tmp/file': Operation not permitted
 
Old 02-15-2013, 08:28 AM   #7
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
As far as I know rm can delete any type of file. But a wierd thought coming in my mind, if you're not logged in as root/super-user, then even using rm you cannot delete any write protected (i.e. file having no write permission) file for any user, whatever it's type is.
 
Old 02-17-2013, 05:45 PM   #8
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Not true. You can remove a file you don't have permissions for, as long as you have write permission for the directory its sitting in.

file permissions control access to the contents of the file. directory permissions control what you can do to the things that exist in the directory.
 
2 members found this post helpful.
Old 02-17-2013, 06:30 PM   #9
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by David the H. View Post
Not true. You can remove a file you don't have permissions for, as long as you have write permission for the directory its sitting in.

file permissions control access to the contents of the file. directory permissions control what you can do to the things that exist in the directory.
Thanks for correction David. OP can conclude that rm won't delete files/dir. which are inside a write protected directory. Or user cannot delete a file/dir. from a directory that has set sticky bit and user isn't it's owner or root.
 
  


Reply



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
Trying to identify file types(command line arguments) and count how many there are jdwalk Linux - Newbie 5 02-20-2010 03:51 PM
Command For Finding Specific File Types? forkbeard Linux - Newbie 7 10-16-2009 12:02 AM
Keep specific file types, delete the rest ? jchambers Programming 5 11-26-2007 06:25 PM
Find command - multiple file types mrclisdue Linux - General 4 07-03-2006 03:48 AM
ha ha i forgot command how to delete file tarak4u Linux - General 2 05-16-2002 01:14 AM

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

All times are GMT -5. The time now is 09:50 PM.

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