title: Bash move file to folder of same name
body: <p>I apologize in advance if I am posting this in the wrong location, I am very new to scripting let alone stackoverflow:</p>
  
  <p>I have a number of files ending in <code>.conf</code> in the same directory as a number of folders with the same names without the <code>.conf</code> extension. For example, my directory looks like this:</p>
  
  <pre><code>136
  136.conf
  139
  139.conf
  ...
  </code></pre>
  
  <p>I would like to move the <code>.conf</code> files into their corresponding folder with a loop. I thought I could do this:</p>
  
  <pre><code>for f in *.conf; do
      dir=${f:0:13}
      mv "$f" "$dir"
  done
  </code></pre>
  
  <p>but I am obviously doing something incorrectly. I would greatly appreciate anyone's help with this.</p>