Professional Web Applications Themes

remove empty directories - Linux / Unix Administration

Hello group, SCO UNIX Openserver 5 Do you know how to delete recursively empty directories ? Thanks. Christophe BADET...

  1. #1

    Default remove empty directories

    Hello group,

    SCO UNIX Openserver 5

    Do you know how to delete recursively empty directories ?

    Thanks.
    Christophe BADET


    Christophe Guest

  2. #2

    Default Re: remove empty directories

    In article <4309c60e$0$12412$free.fr>,
    "Christophe BADET" <Fr> wrote:
     

    Doesn't SCO implement

    rm -rf

    --
    DeeDee, don't press that button! DeeDee! NO! Dee...



    Michael Guest

  3. #3

    Default Re: remove empty directories

    Hmmm,

    i want to remove only empty directories, not all directories.

    "Michael Vilain" <net> a écrit dans le message de news:
    dca.giganews.com... 
    >
    > Doesn't SCO implement
    >
    > rm -rf
    >
    > --
    > DeeDee, don't press that button! DeeDee! NO! Dee...
    >
    >
    >[/ref]


    Christophe Guest

  4. #4

    Default Re: remove empty directories

    Michael Vilain <net> writes:
     
    >
    > Doesn't SCO implement
    >
    > rm -rf
    >[/ref]

    I am sure that the OP doesn't want to delete non-empty directories
    (i.e. those containing regular files) ...

    Maybe something along the line of

    find . -type f -prune

    or whatever syntax SCO uses ...

    --
    Dragan Cvetkovic,

    To be or not to be is true. G. Boole No it isn't. L. E. J. Brouwer

    !!! Sender/From address is bogus. Use reply-to one !!!
    Dragan Guest

  5. #5

    Default Re: remove empty directories

    j'ai trouvé:

    find . -type d -exec rmdir {} 2>/dev/null

    "Dragan Cvetkovic" <net> a écrit dans le message de news:
    net... 
    >>
    >> Doesn't SCO implement
    >>
    >> rm -rf
    >>[/ref]
    >
    > I am sure that the OP doesn't want to delete non-empty directories
    > (i.e. those containing regular files) ...
    >
    > Maybe something along the line of
    >
    > find . -type f -prune
    >
    > or whatever syntax SCO uses ...
    >
    > --
    > Dragan Cvetkovic,
    >
    > To be or not to be is true. G. Boole No it isn't. L. E. J. Brouwer
    >
    > !!! Sender/From address is bogus. Use reply-to one !!![/ref]


    Christophe Guest

  6. #6

    Default Re: remove empty directories

    Christophe BADET wrote: 

    This will only trim the bottom because none of the
    parent directories will be empty. The OP seemed
    to want to start at the bottom, delete all empty
    directories, and to keep deleting when those
    deletions emptied parents. Add a -depth clause:

    find . -depth -type d -exec rmdir {} 2>/dev/null

    I prefer an ending like: -print | xargs -1 rmdir
    but that only works if you know in advance there are
    no interesting characters in file names.

    Any non-empty directory will fail on its deletion,
    no non-directory entries will be deleted.

    Doug Guest

  7. #7

    Default Re: remove empty directories

    Doug Freyburger wrote: 
    >
    >
    > This will only trim the bottom because none of the
    > parent directories will be empty. The OP seemed
    > to want to start at the bottom, delete all empty
    > directories, and to keep deleting when those
    > deletions emptied parents. Add a -depth clause:
    >
    > find . -depth -type d -exec rmdir {} 2>/dev/null
    >
    > I prefer an ending like: -print | xargs -1 rmdir
    > but that only works if you know in advance there are
    > no interesting characters in file names.
    >
    > Any non-empty directory will fail on its deletion,
    > no non-directory entries will be deleted.
    >[/ref]

    what about:

    find . -empty -type d | xargs rmdir

    Assuming SCO uses the gnu find

    Mark
    Mark Guest

  8. #8

    Default Re: remove empty directories

    On Tue, 23 Aug 2005 17:06:10 -0400, Mark <com> wrote:
     

    Haven't been keeping up with the news, have you Mark?

    Dave Guest

Similar Threads

  1. #40228 [NEW]: extractTo not extracting empty directories
    By php-bugs at spuetz dot ath dot cx in forum PHP Bugs
    Replies: 8
    Last Post: January 29th, 04:02 PM
  2. #39458 [NEW]: ftp_nlist returns false on empty directories
    By brain at eucoders dot com in forum PHP Bugs
    Replies: 14
    Last Post: January 3rd, 10:48 PM
  3. #39458 [Opn]: ftp_nlist returns false on empty directories
    By brain at eucoders dot com in forum PHP Bugs
    Replies: 1
    Last Post: November 10th, 12:07 PM
  4. Remove need for Virtual Directories
    By Robio in forum Coldfusion Server Administration
    Replies: 2
    Last Post: November 27th, 06:28 PM
  5. Automaticly remove empty lines out of source code
    By Keitai in forum Macromedia Dreamweaver
    Replies: 5
    Last Post: July 31st, 01:57 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139