[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rm question



To recursively remove a directory "foo", all files and subdirectories, and not
be queried about the request:

    rm -rf foo

Please note that this is not an undoable operation, and you can
seriously fsck things up if you do the wrong thing, particularly as
root.

One trick I'll sometimes do when I don't trust my fingers is to change
permissions on the directory tree first, to something other than root
(this can be an annoying problem if you get it wrong, but is rarely
fatal).  Then I 'su' to that user and remove the files:

   su -
   cd foo/..
   chmod -R nobody.nobody foo
   ls -l    # Did you do what you meant to do?
   su nobody
   rm -rf foo
   
User 'nobody' should have minimal permissions, and shouldn't be able to
hurt anything significant on the system.

On Tue, Mar 28, 2000 at 04:47:38PM +0000, Antonio Rodriguez wrote:
> I want to delete a directory with a whole bunch of embeded
> subdirectories, I did
> rm -d kdeo
>  and I get Operation not permitted.
> Now, I am doing it as root, so, the permission should not be an issue.
> Whats the problem? Is there a better way of removing a sequence of such
> embedded directories?
> Thanks,
> Antonio.
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
> 

-- 
Karsten M. Self (kmself@ix.netcom.com)
    What part of "Gestalt" don't you understand?
    http://gestalt-system.sourceforge.net/


Reply to: