[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] delete all files but leave folder structure intact
- Subject: [ale] delete all files but leave folder structure intact
- From: mike at trausch.us (Michael B. Trausch)
- Date: Mon, 18 Apr 2011 15:45:22 -0400
- In-reply-to: <[email protected]>
- References: <[email protected]>
On 04/18/2011 03:13 PM, Narahari 'n' Savitha wrote:
> How can I accomplish this in the linux world ?
At the top level directory:
find . -type f -exec rm {} \;
Or, for ANY directory:
find /path/to/dir -type f -exec rm {} \;
Or you could do it this way:
find /path/to/dir -print0 | xargs -0 rm
As always, BE CAREFUL when doing something like that. You don't want to
delete all of the files from the wrong directory tree!
--- Mike