title: How to go to each directory and execute a command?
body: <p>How do I write a bash script that goes through each directory inside a parent_directory and <strong>executes</strong> a <strong>command</strong> in <strong>each directory</strong>.</p>
  <p>The directory structure is as follows:</p>
  <blockquote>
  <p>parent_directory (name could be anything - doesnt follow a pattern)</p>
  <ul>
  <li>001 (directory names follow this pattern)
  <ul>
  <li>0001.txt (filenames follow this pattern)</li>
  <li>0002.txt</li>
  <li>0003.txt</li>
  </ul>
  </li>
  <li>002
  <ul>
  <li>0001.txt</li>
  <li>0002.txt</li>
  <li>0003.txt</li>
  <li>0004.txt</li>
  </ul>
  </li>
  <li>003
  <ul>
  <li>0001.txt</li>
  </ul>
  </li>
  </ul>
  <p>the number of directories is unknown.</p>
  </blockquote>