Find the answer to your Linux question:
Results 1 to 10 of 10
Is there a Linux equivalent for the DOS "DELTREE"? As far as I know, "rmdir" cannot remove non-empty directories....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    139

    Linux equivalent for "DELTREE"?


    Is there a Linux equivalent for the DOS "DELTREE"? As far as I know, "rmdir" cannot remove non-empty directories.

  2. #2
    Linux User
    Join Date
    Jan 2005
    Location
    Arizona
    Posts
    288
    rm -r
    man rm for details
    Michael Salivar

    Man knows himself insofar as he knows the world, becoming aware of it only in himself, and of himself only within it.
    --Goethe

  3. #3
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    It still may balk at you, so you may need to force remove:

    Code:
    rm -Rf directoryname
    As always, be *very* careful using this command, particularly as root.
    Registered Linux user #270181
    TechieMoe's Tech Rants

  4. #4
    Linux Engineer
    Join Date
    Nov 2004
    Location
    Montreal, Canada
    Posts
    1,267
    Quote Originally Posted by techieMoe
    It still may balk at you, so you may need to force remove:

    Code:
    rm -Rf
    As always, be *very* careful using this command, particularly as root.
    Idd even say more then *very* be : VERY carefull...
    \"Meditative mind\'s is like a vast ocean... whatever strikes the surface, the bottom stays calm\" - Dalai Lama
    \"Competition ultimatly comes down to one thing... a loser and a winner.\" - Ugo Deschamps

  5. #5
    Linux User
    Join Date
    Jan 2005
    Location
    Arizona
    Posts
    288
    Yeah, it's surprisingly easy to delete things like, say, /etc.

    One late night I was searching for my perfect terminal, and upon uninstalling one I went to remove dot files and check /etc for confs:

    [root@demerzel ethyriel]# rm -R .footermls /etc
    rm: cannot remove '.footermls': No such file or directory

    Now why the hell would it tell me that?

    Wait for it, wait for it...

    I think they heard my screams in Santa Fe.

    Everyone's made stupid mistakes like this at some point or another. To avoid them, you might look up libtrash.
    Michael Salivar

    Man knows himself insofar as he knows the world, becoming aware of it only in himself, and of himself only within it.
    --Goethe

  6. #6
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    139
    Quote Originally Posted by UgoDeschamps
    Quote Originally Posted by techieMoe
    It still may balk at you, so you may need to force remove:

    Code:
    rm -Rf
    As always, be *very* careful using this command, particularly as root.
    Idd even say more then *very* be : VERY carefull...
    Yeah, especially when "rm -r" does not even prompt.

  7. #7
    Linux User
    Join Date
    Jan 2005
    Location
    Arizona
    Posts
    288
    If what you want is a prompt try rm -ri, or you could make an alias to deltree or some such to do this automatically.
    Michael Salivar

    Man knows himself insofar as he knows the world, becoming aware of it only in himself, and of himself only within it.
    --Goethe

  8. #8
    Linux Guru loft306's Avatar
    Join Date
    Oct 2003
    Location
    The DairyLand
    Posts
    1,666
    Quote Originally Posted by UgoDeschamps

    Idd even say more then *very* be : VERY carefull...
    Yeah! when i use the
    Code:
    rm -Rf
    command i type out what i want to remove first check it twice...then add the
    Code:
    rm -Rf
    at the beginning of the line just so i cant go and royaly goof and rm the entire / directory if i happen to hit enter to soon


    P.s> this in me just comes from when i was 12years old and formatted a hdd with my schools entire newley put on puter records.....took all the students 4 months to complete....needless to say i was in the doghouse! and suspended.....now if the puter teacher cound of just of hooked up the tape backup
    ~Mike ~~~ Forum Rules
    Testing? What's that? If it compiles, it is good, if it boots up, it is perfect. ~ Linus Torvalds
    http://loft306.org

  9. #9
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    139
    Quote Originally Posted by Ethyriel
    Yeah, it's surprisingly easy to delete things like, say, /etc.

    One late night I was searching for my perfect terminal, and upon uninstalling one I went to remove dot files and check /etc for confs:

    [root@demerzel ethyriel]# rm -R .footermls /etc
    rm: cannot remove '.footermls': No such file or directory

    Now why the hell would it tell me that?
    Probably because it can't remove a file and a folder at the same time. You probably have to remove the file, then remove the folder.

  10. #10
    Linux User
    Join Date
    Jan 2005
    Location
    Arizona
    Posts
    288
    Quote Originally Posted by user222
    Probably because it can't remove a file and a folder at the same time. You probably have to remove the file, then remove the folder.
    or because I forgot the semicolon
    Michael Salivar

    Man knows himself insofar as he knows the world, becoming aware of it only in himself, and of himself only within it.
    --Goethe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •