title: Flatten directory structure and preserve duplicate files
body: <p>I have a directory structure that looks like this:</p>
  
  <pre><code>foo
  ├── 1.txt
  ├── 2.txt
  ├── 3.txt
  ├── 4.txt
  └── bar
      ├── 1.txt
      ├── 2.txt
      └── 5.txt
  </code></pre>
  
  <p>I would like to flatten this directory structure so that all files are in the foo directory and duplicate files are preserved:</p>
  
  <pre><code>foo
  ├── 1.txt
  ├── 2.txt
  ├── 3.txt
  ├── 4.txt
  ├── bar-1.txt
  ├── bar-2.txt
  └── bar-5.txt
  </code></pre>
  
  <p>The file names of the renamed duplicates is insignificant.</p>
  
  <p>Is there a simple Unix one-liner or simple shell script I can use to do this?</p>