How to check if a CID is already pinned on my IPFS node?

I have many CIDs on nft.storage and i want to pin them on my own local node. But I only want to take the latest CIDs. So, how can I check if a CID is already pinned on my node.

Or is there a better way to find CIDs that are not pinned yet and pin them?

1 Like

You can use ipfs pin ls to list all your pins.

You can use ipfs pin ls | grep <cid> to check if a specific CID is pinned (it will return nothing if not, and something if pinned).

1 Like