# How can i list all the files that are in a repository?

**URL:** <https://community.sonatype.com/t/how-can-i-list-all-the-files-that-are-in-a-repository/5201>\
**Category:** Sonatype Nexus Repository\
**Tags:** nexus-repository\
**Created:** [October 23, 2020, 3:28pm UTC](https://community.sonatype.com/t/how-can-i-list-all-the-files-that-are-in-a-repository/5201 "2020-10-23T15:28:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![demianpelos](https://avatars.discourse-cdn.com/v4/letter/d/9de053/32.png) [@demianpelos](https://community.sonatype.com/u/demianpelos)\
**Post date:** [October 23, 2020, 3:28pm UTC](https://community.sonatype.com/t/how-can-i-list-all-the-files-that-are-in-a-repository/5201/1 "2020-10-23T15:28:45Z")

</div>

i am trying to make a script in python and we need to know what files are in the repository so we can check the version we have up there and figure out what to upload later on.

is there an Api that list the files? (might be some pagination to do) or there is a python library for that?

thanks guys.

---

<div class="post-metadata">

**Author:** ![turganbaevanurkan](https://avatars.discourse-cdn.com/v4/letter/t/13edae/32.png) [@turganbaevanurkan](https://community.sonatype.com/u/turganbaevanurkan)\
**Post date:** [March 4, 2021, 2:31am UTC](https://community.sonatype.com/t/how-can-i-list-all-the-files-that-are-in-a-repository/5201/2 "2021-03-04T02:31:36Z")

</div>

did you find answer I need script to get old files and delete them with Api  
thanks

---

<div class="post-metadata">

**Author:** ![test](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@test](https://community.sonatype.com/u/test)\
**Post date:** [March 4, 2021, 9:15am UTC](https://community.sonatype.com/t/how-can-i-list-all-the-files-that-are-in-a-repository/5201/3 "2021-03-04T09:15:25Z")

</div>

you can find these in medata dir.  
for example, if this apt repo ,you can find these message in page

https://{URL}/repository/{REPONAME}/dists/bionic/main/binary-all/Packages

 ![download](https://canada1.discourse-cdn.com/flex047/uploads/communitysonatype/original/2X/2/21f3011de813f650aa3d51e30dc8b8eecb2693ba.png)

---

<div class="post-metadata">

**Author:** ![turganbaevanurkan](https://avatars.discourse-cdn.com/v4/letter/t/13edae/32.png) [@turganbaevanurkan](https://community.sonatype.com/u/turganbaevanurkan)\
**Post date:** [March 4, 2021, 1:58pm UTC](https://community.sonatype.com/t/how-can-i-list-all-the-files-that-are-in-a-repository/5201/4 "2021-03-04T13:58:39Z")

</div>

Hilton thank you this is good too and trying add here with year so I can list old artifacts with the year and delete them.

thank you
