title: How to list subfolders in Artifactory
body: <p>I'm trying to write a script which cleans up old builds in my generic file repository in Artifactory. I guess the first step would be to look in the repository and check which builds are in there.</p>
  
  <p>Each build shows up as a subfolder of <code>/foo</code>, so for example I have folders <code>/foo/123</code>, <code>/foo/124</code>, <code>/foo/125</code>/, etc.</p>
  
  <p>There doesn't seem to be a <code>ls</code> or <code>dir</code> command. So I tried the <code>search</code> command:</p>
  
  <pre><code>jfrog rt search my-repo/foo/*
  </code></pre>
  
  <p>But this recursively lists all files, which is not what I'm looking for. I just need the list of direct subfolders. I also tried</p>
  
  <pre><code>jfrog rt search my-repo/foo/* --recursive=false
  </code></pre>
  
  <p>but this doesn't return any results, because the search command only returns files, not folders.</p>
  
  <p>How do I list the subfolders of a given folder in an Artifactory repository?</p>