title: Rename files in multiple directories (recursive) to the name of the directory (linux)
body: <p>I am trying to figure out how to rename files in my dir structure (movies) and to unify the names there ...</p>
  
  <p>Is there any way how to achieve the following scenario?</p>
  
  <p>example:</p>
  
  <pre><code>\tmp\test\my folder\v.txt
  \tmp\test\my folder\w.pdf
  
  \tmp\test\test folder\my subfolder\x.jpg
  \tmp\test\test folder\my subfolder\y.log
  
  \tmp\test\new folder\my path\tester\z.png
  </code></pre>
  
  <p>expected result:</p>
  
  <pre><code>\tmp\test\my folder\my folder.txt
  \tmp\test\my folder\my folder.pdf
  
  \tmp\test\test folder\my subfolder\my subfolder.jpg
  \tmp\test\test folder\my subfolder\my subfolder.log
  
  \tmp\test\new folder\my path\tester\tester.png
  </code></pre>
  
  <p>I was trying something but this is too much for a rookie like me :)</p>
  
  <p>Thank you</p>