Re: How can I delete directories that are not empty?

From: Robert Hull (Robert_at_please.do-not-spam.me.uk)
Date: 09/01/03

  • Next message: Doug Davis: "Abit IS7 Gigabit Ethernet"
    Date: Mon, 1 Sep 2003 18:08:17 +0100
    
    

    In message <7go6lvofiuss0jpnoh5b8ak8ek0ctsvcov@4ax.com>, Barry OGrady
    <god_freee_jones@hotmail.com> wrote
    >On Sat, 30 Aug 2003 19:28:30 +0300, "PM" <mooney@cytanet.com.cy> wrote:
    >
    >>On Sun, 31 Aug 2003 01:11:55 +1000, Barry OGrady wrote:
    >>
    >>> On Tue, 29 Jul 2003 13:41:17 GMT, takashi <twakeshi@telus.net> wrote:
    >>>
    >>>>Hi. I have had troubled deleting directories that are not empty. When I
    >>>>use a command " rmdir directoryName ", bash complains that the directory
    >>>>is not empty. Do I have to delete all the files inside the directory
    >>>>first? But how can I delete all the files with one command? I really
    >>>>don't want to delete one file at a time, using " rm fileName".
    >>>> Thank you, and have a good day.
    >>>
    >>> rm *
    >>>
    >>>
    >>> -Barry
    >>> ========
    >>> Web page: http://members.optusnet.com.au/~barry.og
    >>> Atheist, radio scanner, LIPD information.
    >>> Voicemail/fax number +14136227640
    >>
    >>
    >>Did you really mean rm * ?
    >>
    >>Won't that do just a little bit more than intended?
    >
    >You are right. What about rm dirname?
    >
    That will fail if the directory is not empty unless you use either -r or
    --recursive to remove the files in the directory recursively.

    If you are root, you can use -d to remove the directory whether empty or
    not but I do not know what happens to the files in that directory in
    that case.

    -- 
    Robert
    This information provided free of charge for those willing to accept
    it. Others who wish to be spoon-fed may acquire my services at the
    discounted rate of 80 GB Pounds per hour or part thereof.
    

  • Next message: Doug Davis: "Abit IS7 Gigabit Ethernet"

    Relevant Pages