title: Linux Move files to their child directory in a loop
body: <p>Can you please suggest efficient way to move files from one location to their sub directory in a loop.</p>
  
  <p>Ex:</p>
  
  <p><code>/MY_PATH/User1/1234/Daily/abc.txt</code> to <code>/MY_PATH/User1/1234/Daily/Archive/abc.txt</code>     </p>
  
  <p><code>/MY_PATH/User2/3456/Daily/def.txt</code> to <code>/MY_PATH/User2/3456/Daily/Archive/def.txt</code>    </p>
  
  <p><code>/MY_PATH/User1/1111/Daily/hij.txt</code> to <code>/MY_PATH/User1/1111/Daily/Archive/hij.txt</code></p>
  
  <p><code>/MY_PATH/User2/2222/Daily/def.txt</code> to <code>/MY_PATH/User2/2222/Daily/Archive/def.txt</code>    </p>
  
  <p>I started in this way, but need your suggestions and best way to write it:</p>
  
  <pre><code>#!/bin/bash
  
  dir1="/MyPath/"
  
  subs= `ls $dir1`
  
  for i in $subs; do
    mv $dir1/$i/*/Daily $dir1/$i/*/Daily/Archive 
  done
  </code></pre>