Solved

rm -d

Posted on 1997-04-29
3
488 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:
Suggested Courses

734 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