How can I find the raw data in $IPFS_PATH/blocks? Which dir is it in?

$ mkdir -p foo/bar
$ echo "baz" > foo/baz
$ echo "baz" > foo/bar/baz
$ tree
└── foo
    ├── bar
    │   └── baz
    └── baz

2 directories, 2 files
$ ipfs add -r foo
added QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR foo/bar/baz
added QmWLdkp93sNxGRjnFHPaYg8tCQ35NBY3XPn6KiETd3Z4WR foo/baz
added QmeBpzHngbHes9hoPjfDCmpNHGztkmZFRX4Yp9ftKcXZDN foo/bar
added QmdcYvbv8FSBfbq1VVSfbjLokVaBYRLKHShpnXu3crd3Gm foo

How can I find the raw data, eg “baz” in $IPFS_PATH/blocks? which dir is it in?

This is explained by a file called _README in the blocks directory. Basically you have to convert the base58 encoded Cd string to a base32 encoding, then use the third to last and second to last character to find the directory.

The file will have an extension .data and will contain an additional header in addition to the string “baz”.