<div dir="ltr"><div><div><div>Why all the extra effort of writing a script, when a single find command would suffice? That way you're not passing file names between processes, or building lists, and avoid having to remember quotes in too many places, or set IFS, etc.<br>
<br></div> $ find /path/to/source/files/ -type f -exec mv '{}' /path/to/destination/ \;<br><br>If you're not sure if that is safe yet, throw an echo into the command:<br><br> $ find /path/to/source/files/ -type f -exec echo mv '{}' /path/to/destination/ \;<br>
<br></div>Remove empty directories when complete:<br><br></div> $ find /path/to/source/files -type d -empty -delete<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jun 18, 2013 at 11:55 AM, R. Brent Clements <span dir="ltr"><<a href="mailto:rbclemen@gmail.com" target="_blank">rbclemen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I need to do something dramatically destructive. I want to take a large directory tree of folders, and collapse them all down to their root folder. File collisions are irrelevant. How would you guys do this? (assume for the moment that you would).<br>
</div>
<br>_______________________________________________<br>
kwlug-disc mailing list<br>
<a href="mailto:kwlug-disc@kwlug.org">kwlug-disc@kwlug.org</a><br>
<a href="http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org" target="_blank">http://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Chris Irwin<br><<a href="mailto:chris@chrisirwin.ca" target="_blank">chris@chrisirwin.ca</a>></div>
</div>