title: Creating complex path structure in linux
body: <p>I am having trouble creating the following directory structure. It is to test a scanner program to see if it can handle it.</p>
  <ul>
  <li>Start inside <code>/data/</code></li>
  <li>Inside <code>/data/</code> there are 2 sub-directories. <code>/data/sub1</code> and <code>/data/sub2</code></li>
  </ul>
  <p>Now, this gets complex :)</p>
  <ul>
  <li><p>In each of the sub-directories there are  2 more sub-directories. For first sub: <code>/data/sub1/sub1/ and /data/sub1/sub2</code> and for second sub <code>/data/sub2/sub1/ and /data/sub2/sub2</code></p>
  </li>
  <li><p>... this goes on to a depth of 16 levels, with a total directory of <code>65,536</code>.</p>
  </li>
  </ul>
  <p>What I have so far, this only creates 1 subdirectory inside <code>/data/</code>, 16 folders deep. I am thinking of using the following script recursively for the subdirectories created along the way. And for the subdirectories it then creates. And so on. But I can't imagine scripting it.</p>
  <pre><code>count=0;
  folder=$(printf &quot;Folder%02dB&quot; $count); 
  mkdir -p $folder;
  while [ $count -lt 16 ]; do 
      ((count=$count+1));
      folder=$(printf &quot;Folder%02dB&quot; $count); 
      mkdir -p $folder;
      cd $folder;
  done
  </code></pre>
  <p>Anyone has any ideas on how to create such directory structure? How to proceed? Thanks!</p>