[ale] delete all files but leave folder structure intact

Ed Cashin ecashin at noserose.net
Mon Apr 18 15:22:18 EDT 2011


To read into your question a bit, I'll assume you'd like to remove
special files and symbolic links and named fifos as well as regular
files.

  find xyz ! -type d -print0 | xargs -0 rm

To just remove regular files, you could,

  find xyz -type f -print0 | xargs -0 rm

You could do it using "exec" without the xargs command, but it would
run more slowly, because more rm processes would need to be created.

On Mon, Apr 18, 2011 at 3:13 PM, Narahari 'n' Savitha
<savithari at gmail.com> wrote:
> Friends:
>
> On the Windoze DOS world there is a command I can type del  /s /f /q xyz
> (where xyz is a folder)..
>
> This will delete all the files only and leaves the folder structure intact.
>
> How can I accomplish this in the linux world ?
>
> Thanks
>
> -Narahari
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>



-- 
  Ed Cashin <ecashin at noserose.net>
  http://noserose.net/e/
  http://www.coraid.com/



More information about the Ale mailing list