title: How to limit depth for recursive file list?
body: <p>Is there a way to limit the depth of a recursive file listing in linux?</p>
  
  <p>The command I'm using at the moment is:</p>
  
  <pre><code>ls -laR &gt; dirlist.txt
  </code></pre>
  
  <p>But I've got about 200 directories and each of them have 10's of directories. So it's just going to take far too long and hog too many system resources.</p>
  
  <p>All I'm really interested in is the ownership and permissions information for the first level subdirectories:</p>
  
  <pre><code>drwxr-xr-x 14 root   root  1234 Dec 22 13:19 /var/www/vhosts/domain1.co.uk  
  drwxr--r-- 14 jon    root  1234 Dec 22 13:19 /var/www/vhosts/domain1.co.uk/htdocs  
  drwxr--r-- 14 jon    root  1234 Dec 22 13:19 /var/www/vhosts/domain1.co.uk/cgi-bin  
  drwxr-xr-x 14 root   root  1234 Dec 22 13:19 /var/www/vhosts/domain2.co.uk  
  drwxr-xrwx 14 proftp root  1234 Dec 22 13:19 /var/www/vhosts/domain2.co.uk/htdocs  
  drwxr-xrwx 14 proftp root  1234 Dec 22 13:19 /var/www/vhosts/domain2.co.uk/cgi-bin  
  drwxr-xr-x 14 root   root  1234 Dec 22 13:19 /var/www/vhosts/domain3.co.uk  
  drwxr-xr-- 14 jon    root  1234 Dec 22 13:19 /var/www/vhosts/domain3.co.uk/htdocs  
  drwxr-xr-- 14 jon    root  1234 Dec 22 13:19 /var/www/vhosts/domain3.co.uk/cgi-bin  
  drwxr-xr-x 14 root   root  1234 Dec 22 13:19 /var/www/vhosts/domain4.co.uk  
  drwxr-xr-- 14 jon    root  1234 Dec 22 13:19 /var/www/vhosts/domain4.co.uk/htdocs
  drwxr-xr-- 14 jon    root  1234 Dec 22 13:19 /var/www/vhosts/domain4.co.uk/cgi-bin
  </code></pre>
  
  <p><b>EDIT:</b></p>
  
  <p>Final choice of command:</p>
  
  <pre><code>find -maxdepth 2 -type d -ls &gt;dirlist
  </code></pre>