title: How do I recursively list all directories at a location, breadth-first?
body: <p>Breadth-first list is important, here. Also, limiting the depth searched would be nice.</p>
  
  <pre><code>$ find . -type d
  /foo
  /foo/subfoo
  /foo/subfoo/subsub
  /foo/subfoo/subsub/subsubsub
  /bar
  /bar/subbar
  
  $ find . -type d -depth
  /foo/subfoo/subsub/subsubsub
  /foo/subfoo/subsub
  /foo/subfoo
  /foo
  /bar/subbar
  /bar
  
  $ &lt; what goes here? &gt;
  /foo
  /bar
  /foo/subfoo
  /bar/subbar
  /foo/subfoo/subsub
  /foo/subfoo/subsub/subsubsub
  </code></pre>
  
  <p>I'd like to do this using a bash one-liner, if possible. If there were a javascript-shell, I'd imagine something like</p>
  
  <pre><code>bash("find . -type d").sort( function (x) x.findall(/\//g).length; )
  </code></pre>