2

Is there an way to remove all the files from the current dir (recursively), keeping the directory structure?

1 Answer 1

7
find . -type f -exec rm {} \;

Try without rm first to see what it will remove:

find . -type f
2
  • Beat me by about 2 seconds :) Mar 11, 2013 at 12:02
  • 1
    Alternatife for find: --delete (That way it does not need to start rm for each file, so you get less overhead).
    – Hennes
    Mar 11, 2013 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .