Solved

rm -d

Posted on 1997-04-29
3
493 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

617 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