Solved

rm -d

Posted on 1997-04-29
3
474 Views
Last Modified: 2013-12-05
When I try to remove a directory with rm -d, as documented in the rm man page, I always get the message "Operation not permitted", even if I login as root. I have tried the same thing on a FreeBSD system, and it worked, even if the situation was the same, with the same access privileges for all the files involved. Can you help me?
(I want to use rm -d, not rmdir or rm -r; in fact the same thing happens if I write a program which uses the unlink system call)
0
Comment
Question by:alfredotod
3 Comments
 
LVL 1

Expert Comment

by:strobert
ID: 1626220
what linux distribution (redhat/slackware) are you using?
Also what kernel version?

why not rm -rf?  
if the directory is not empty then the filesystem should get checked to free the blocks.  (basically refs to the used blacks get nuked, but the blocks don't get marked as free).

It looks to be a bug in the unlink syscall.  I'll let you know if I find for info.
0
 
LVL 1

Accepted Solution

by:
fln earned 100 total points
ID: 1626221
In linux usr rm -R
capital R to remove a dir, or rm -Rf to put som power behind...
0
 
LVL 2

Expert Comment

by:jprohart
ID: 1626222
according to the man page -r and -R are equiv (redhat 4.0 manpages)

he wanted to be able to do a rm -d
this does a unlink on the dir, all contents basically get left floating attached to nothing (why I said -- quoting the man page -- that you should do a fsck after the command)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iptables limit connection per ip correct way ? 2 94
Linux server cannot access samba share 12 91
Oracle 12c patching 1 61
Error Message during CentOS 7 Minimal Install 3 34
This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now