# Getting the file names of files I pinned locally

**URL:** <https://discuss.ipfs.tech/t/getting-the-file-names-of-files-i-pinned-locally/14655>\
**Category:** Kubo\
**Tags:** go-ipfs\
**Created:** [July 9, 2022, 10:49pm UTC](https://discuss.ipfs.tech/t/getting-the-file-names-of-files-i-pinned-locally/14655 "2022-07-09T22:49:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![danieln](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ipfs.tech/danieln/32/6408_2.png) [@danieln](https://discuss.ipfs.tech/u/danieln)\
**Post date:** [July 12, 2022, 11:01am UTC](https://discuss.ipfs.tech/t/getting-the-file-names-of-files-i-pinned-locally/14655/2 "2022-07-12T11:01:17Z")

</div>

Welcome to the forum, @chaser 👋

You can use the following command to get more information about a CID:

```auto
ipfs dag get [CID]

```

This will basically render the [DAG](https://docs.ipfs.io/concepts/merkle-dag/) of the CID.

Alternatively, you can visualise the DAG using [https://explore.ipld.io/](https://explore.ipld.io/) (as long as the CID is retrievable).

The problem you might face when you add a single file to IPFS, is that the filename is **not** added to the dag. For example, the following CID, is of an image

```auto
ipfs dag get bafybeibml5uieyxa5tufngvg7fgwbkwvlsuntwbxgtskoqynbt7wlchmfm
# Returns
{"Data":{"/":{"bytes":"CAIYu7xiIICAECCAgBAggIAQIICAECCAgBAggIAQILu8Ag"}},"Links":[{"Hash":{"/":"Qmevts91okBJSZ13BWksZZ2CNVeUufwKTbcrRQCHcnDZ4Z"},"Name":"","Tsize":262158},{"Hash":{"/":"QmdkWRASeEw5m6ZK3DsCtYyr7Vp7FJdJbKVLnzhbECbac9"},"Name":"","Tsize":262158},{"Hash":{"/":"QmfAkyyti6N8w7iNVENRoFxXc4Dy9DVESCVpYs1txq6LaC"},"Name":"","Tsize":262158},{"Hash":{"/":"QmVzgY3zF5SuiunkgxUBBzzAXvLqKBxLrpqYBLkA5Gqy9u"},"Name":"","Tsize":262158},{"Hash":{"/":"QmYQRe6seMnpN87gh5DiSZNAuwirG6tHmqwhzinxYoqUF4"},"Name":"","Tsize":262158},{"Hash":{"/":"Qma46hN6o1AqygGzu8iVSX6RoS5i1jRuq5G4phHnFjh9U3"},"Name":"","Tsize":262158},{"Hash":{"/":"QmZsRbDt6i6LQj7bEdggY3xJokL5cTHsrN6WZdc698yhgW"},"Name":"","Tsize":40521}]}

```

If you are interested in retaining the information about the filename in the dag, you can use the ` -w, --wrap-with-directory bool - Wrap files with a directory object.` option which will add the filename to the DAG.

For example

```auto
ipfs add -w --cid-version=1 practical-explainer-ipfs-gateways-part-2.md

added bafkreihmhz6l4fjqp43cnhgsaw3oecsi2fcr47adirtt5g2g7ymommylea practical-explainer-ipfs-gateways-part-2.md
added bafybeicq43ymchctaila64ifhxebkariywdbtiub7xnm5xldtsyhx5wawa

```

You get two CIDs returned, one for the file (just the binary representation without the filename) and one for the “folder” which contains a single file with the filename:

If you inspect the second CID, you get:

```auto
$ ipfs dag get bafybeicq43ymchctaila64ifhxebkariywdbtiub7xnm5xldtsyhx5wawa
{"Data":{"/":{"bytes":"CAE"}},"Links":[{"Hash":{"/":"bafkreihmhz6l4fjqp43cnhgsaw3oecsi2fcr47adirtt5g2g7ymommylea"},"Name":"practical-explainer-ipfs-gateways-part-2.md","Tsize":21006}]}

```

Also, everything you add using `ipfs add` is automatically pinned to your local node.

Hope that helps!

---

_[View the full topic](https://discuss.ipfs.tech/t/getting-the-file-names-of-files-i-pinned-locally/14655)._
