Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Yes, it was me who answered that question (and the same "solution" is also on this question). =P Commented Jun 29, 2013 at 3:34
  • @AlixAxel - Ha, sorry I didn't even notice you answered that one. Oh well. Shall I delete this answer then? Commented Jun 29, 2013 at 8:19
  • 3
    Using rsync to prune directories doesn't feel right and there is always danger with rm -rf. I'd recommend the 2nd step to be: find source/ -d -type d -exec rmdir {} \; Commented Dec 13, 2013 at 14:10
  • 3
    I just feel compelled to add, never use -delete and --remove-source-files in a single rsync command (the above examples are fine, this is tangential). If you interrupt then re-execute what I'm describing, you'll lose transferred files. Which I've done before :( Commented Jul 16, 2015 at 19:03
  • When cleaning up with find, I prefer this: find source/ -type d -empty -delete It gives me a weird sense of reassurance that it won't just clobber everything. Commented Apr 5, 2018 at 22:58