Solved

rm -d

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

758 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

27 Experts available now in Live!

Get 1:1 Help Now