How can I remove a directory and all its contents?

From @jamiewilson on Mon Mar 20 2017 20:53:50 GMT+0000 (UTC)

I have this object, a directory with the following contents:

$ ipfs file ls fZXmMYYCQYeUUadmvx23LXR3CQRGoK881mJoKAPT8fZGR6

But when I go to remove this folder with the ipfs files rm command, I get the following message:

$ ipfs files rm -r fZXmMYYCQYeUUadmvx23LXR3CQRGoK881mJoKAPT8fZGR6
Error: Paths must start with a leading slash.

$ ipfs files rm -r /fZXmMYYCQYeUUadmvx23LXR3CQRGoK881mJoKAPT8fZGR6
Error: merkledag: not found

Does anyone know what I’m doing wrong here? Thanks for the help.

Copied from original issue: