# List all remote paths of tracked files

**URL:** <https://discuss.dvc.org/t/list-all-remote-paths-of-tracked-files/863>\
**Category:** Questions\
**Created:** [September 2, 2021, 4:58am UTC](https://discuss.dvc.org/t/list-all-remote-paths-of-tracked-files/863 "2021-09-02T04:58:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmiller](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@jmiller](https://discuss.dvc.org/u/jmiller)\
**Post date:** [September 2, 2021, 4:58am UTC](https://discuss.dvc.org/t/list-all-remote-paths-of-tracked-files/863/1 "2021-09-02T04:58:48Z")

</div>

For a given commit, I’d like to get a list of the local paths & corresponding remote paths of all files tracked by DVC, possibly limited to a certain directory. Is there not an easy way to do this?

Currently looking at a workaround involving “dvc list -R --dvc-only --rev …” to get all tracked files, reading the md5 out of the corresponding .dvc files, and then using those to build the remote paths. Doesn’t seem very elegant.

---

<div class="post-metadata">

**Author:** ![daavoo](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@daavoo](https://discuss.dvc.org/u/daavoo)\
**Post date:** [September 2, 2021, 3:10pm UTC](https://discuss.dvc.org/t/list-all-remote-paths-of-tracked-files/863/2 "2021-09-02T15:10:14Z")

</div>

Hi @jmiller! Might I ask what is the final purpose of this operation?

There is not really a straightforward way to get all the remote paths of a repo, probably what you are already doing would be the easiest way.

Usually, you would be accessing those files directly with either [`dvc get`](https://dvc.org/doc/command-reference/get) or the python API [`dvc.api.read`](https://dvc.org/doc/api-reference/read).

Not sure if this can help but you can use [`dvc get --show-url`](https://dvc.org/doc/command-reference/get#example-getting-the-storage-url-of-a-dvc-tracked-file) to “print the storage location (URL) of the target data”. Alternatively, you can use the python API [`dvc.api.get_url`](https://dvc.org/doc/api-reference/get_url).

---

<div class="post-metadata">

**Author:** ![jmiller](https://avatars.discourse-cdn.com/v4/letter/j/d9b06d/32.png) [@jmiller](https://discuss.dvc.org/u/jmiller)\
**Post date:** [September 2, 2021, 3:57pm UTC](https://discuss.dvc.org/t/list-all-remote-paths-of-tracked-files/863/3 "2021-09-02T15:57:47Z")

</div>

Thanks! Possibly I’m not using dvc for its intended purposes. I want to load the data, as it was at a certain commit, into a cloud database and/or data visualization tool. Doing this directly with the remote copy of the data (s3) seems to make the most sense, because it doesn’t require me to upload another copy of the data to the cloud first.

Currently my repo has local cache but eventually I’d like to have all data stored in the cloud, not in a local workspace or cache at all, since the data is quite large.

---

<div class="post-metadata">

**Author:** ![daavoo](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@daavoo](https://discuss.dvc.org/u/daavoo)\
**Post date:** [September 6, 2021, 8:37am UTC](https://discuss.dvc.org/t/list-all-remote-paths-of-tracked-files/863/4 "2021-09-06T08:37:28Z")

</div>

From Python API [`dvc.api.open`](https://dvc.org/doc/api-reference/open):

> makes a direct connection to the [remote storage](https://dvc.org/doc/command-reference/remote/add#supported-storage-types) (except for Google Drive), so the file contents can be streamed.

So using the API won’t create a copy of the data, but `dvc get` will.
