基础指令

BASIC COMMANDS
    init          Initialize ipfs local configuration
    add <path>    Add a file to ipfs
    cat <ref>     Show ipfs object data
    get <ref>     Download ipfs objects
    ls <ref>      List links from an object
    refs <ref>    List hashes of links from an object

初始化

$ ipfs init
initializing IPFS node at /Users/leon/.ipfs
generating 2048-bit RSA keypair...done
peer identity: QmTV38V7iSVKeh8Fb9wb5xfTGCM9GfPvy4GoZPXL6RPvP1
to get started, enter:

	ipfs cat /ipfs/QmS4ustL54uo8FzR9455qaxZwuMiUhyvMcX9Ba8nUH4uVv/readme

我们看一下这个仓库里的文件

$ find ~/.ipfs
/Users/leon/.ipfs
/Users/leon/.ipfs/blocks
/Users/leon/.ipfs/blocks/PM
/Users/leon/.ipfs/blocks/PM/CIQKNNRB2NFYXUZDJ2UWNMSKYLGTKUYDRQTJCDI7JTUDFH6YOYNUPMA.data
/Users/leon/.ipfs/blocks/B5
/Users/leon/.ipfs/blocks/B5/CIQDOZU3EAGXWK3PLVFOFOZOAE5USX3XM6I5CSHSQGTML2BAGN7MB5I.data
/Users/leon/.ipfs/blocks/JN
/Users/leon/.ipfs/blocks/JN/CIQPHMHGQLLZXC32FQQW2YVM4KGFORVFJAQYY55VK3WJGLZ2MS4RJNQ.data
/Users/leon/.ipfs/blocks/L5
/Users/leon/.ipfs/blocks/L5/CIQBIQXZ4NWWDXUSIYSCX7RE6EBXHMGENZNMUDEMGNKMGT2K6LLUL5Y.data
/Users/leon/.ipfs/blocks/7J
/Users/leon/.ipfs/blocks/7J/CIQKKLBWAIBQZOIS5X7E32LQAL6236OUKZTMHPQSFIXPWXNZHQOV7JQ.data
/Users/leon/.ipfs/blocks/SHARDING
/Users/leon/.ipfs/blocks/2H
/Users/leon/.ipfs/blocks/2H/CIQN5PVU4ECEKNEVXWRYKCPTVMIPHP5AWWKOCGCPXVNMF7ZWU6UG2HI.data
/Users/leon/.ipfs/blocks/SH
/Users/leon/.ipfs/blocks/SH/CIQL3XIOKVDAW5KQF6NNWGFFYAHEQP63TJOVZHAEO7XZBD7KQOCSSHY.data
/Users/leon/.ipfs/blocks/_README
/Users/leon/.ipfs/blocks/N2
/Users/leon/.ipfs/blocks/N2/CIQDWKPBHXLJ3XVELRJZA2SYY7OGCSX6FRSIZS2VQQPVKOA2Z4VXN2I.data
/Users/leon/.ipfs/blocks/OO
/Users/leon/.ipfs/blocks/OO/CIQBT4N7PS5IZ5IG2ZOUGKFK27IE33WKGJNDW2TY3LSBNQ34R6OVOOQ.data
/Users/leon/.ipfs/blocks/LG
/Users/leon/.ipfs/blocks/LG/CIQJBQD2O6K4CGJVCCTJNUP57QHR4SKHZ74OIITBBGLOMCO3ZOLWLGA.data
/Users/leon/.ipfs/blocks/IL
/Users/leon/.ipfs/blocks/IL/CIQJFGRQHQ45VCQLM7AJNF2GF5UHUAGGHC6LLAH6VYDEKLQMD4QLILY.data
/Users/leon/.ipfs/blocks/7R
/Users/leon/.ipfs/blocks/7R/CIQIVZGLOUFY5L4TEYD5WLSCRDDEAW2TNVZSH3OBM5UKNOREHYSY7RA.data
/Users/leon/.ipfs/blocks/X3
/Users/leon/.ipfs/blocks/X3/CIQFTFEEHEDF6KLBT32BFAGLXEZL4UWFNWM4LFTLMXQBCERZ6CMLX3Y.data
/Users/leon/.ipfs/blocks/R3
/Users/leon/.ipfs/blocks/R3/CIQBED3K6YA5I3QQWLJOCHWXDRK5EXZQILBCKAPEDUJENZ5B5HJ5R3A.data
/Users/leon/.ipfs/blocks/QV
/Users/leon/.ipfs/blocks/QV/CIQOHMGEIKMPYHAUTL57JSEZN64SIJ5OIHSGJG4TJSSJLGI3PBJLQVI.data
/Users/leon/.ipfs/keystore
/Users/leon/.ipfs/config
/Users/leon/.ipfs/datastore
/Users/leon/.ipfs/datastore/000003.log
/Users/leon/.ipfs/datastore/000002.ldb
/Users/leon/.ipfs/datastore/LOCK
/Users/leon/.ipfs/datastore/CURRENT
/Users/leon/.ipfs/datastore/LOG
/Users/leon/.ipfs/datastore/MANIFEST-000004
/Users/leon/.ipfs/version
/Users/leon/.ipfs/datastore_spec

ref