From @lockedshadow on Mon Feb 15 2016 00:20:59 GMT+0000 (UTC)
First of all, apologize for my bad english. Hope that you can understand it.
For example, we created directory named «foo» and put to it files named «bar», «baz», then pinned them recursively by ipfs add
command, like this:
mkdir foo
echo bar > ./foo/bar
echo baz > ./foo/baz
ipfs add -r ./foo
And next we have result:
added QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM foo/bar
added QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR foo/baz
added QmRoqGfDXiwoUBMTKtU9Hbd8W1DTbSGZ4rJmUGtmNXbgY2 foo
Is there an easy way to determine hash of directory «foo» and other pinned directories which contains this objects, if now we know only hashes of «bar» and «baz» (QmTz3oc4gdpRMKP2sdGUPZTAGRngqjsi99BPoztyP53JMM
and QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR
)? Something like ipfs refs --reverse
command.
(At least we can use this workaround: for hash in $(ipfs pin ls -q) ; do ipfs refs -e $hash | grep [hash] ; done
, but maybe built-in solution available?)
Copied from original issue: https://github.com/ipfs/faq/issues/95