Let me sort out the commands that I have used recently.
First, the basic instructions
ipsf initialization:
ipfs init
When you execute ipfs for the first time, it can help you create a configuration file. If there is already a configuration file, the execution will be invalid.
Add profile:
ipfs add "file path"
Display the file content. CID is the ID of each file in IPFS. You can use CID to find the file.
ipfs cat "CID"
ipfs get "CID"
This is a bit of a mystery. You need to understand the IPSF principle. To put it simply, it depends on how many pieces your file has been cut into, how big each piece is, and what is the CID of each piece. Usually, each piece is 262144Byte.
ipfs ls "CID"
List only CIDs of file chunks
ipfs refs "CID"
daemon: Start a long-running daemon process. This command is used to start the daemon process of the IPFS node so that the node can always run in the background.
ipfs daemon
mount: Mount a read-only IPFS mount point. This command is used to mount the IPFS file system to the local file system so that IPFS files can be accessed through the local file system.
ipfs mount /mnt/ipfs
Mount the IPFS file system to the /mnt/ipfs directory.
resolve: Resolve any type of name. This directive is used to resolve IPFS CID, IPNS name or DNS link into the corresponding content.
ipfs resolve /ipns/example.com
Parse the IPNS name /ipns/http://example.com and display the corresponding content.
name: Publish and resolve IPNS names. This directive is used to publish and resolve IPNS names so that they can be used as persistent identifiers that can be used to reference IPFS content.
ipfs name publish --key=mykey Qmabc123
Use the key mykey to publish the content with CID Qmabc123 and return the corresponding IPNS name.
key: Create and list key pairs for IPNS names. This directive is used to create and manage key pairs used to publish and resolve IPNS names.
ipfs key gen mykey
Create a new key pair named mykey.
dns: Resolve DNS links. This directive is used to resolve DNS links into corresponding content.
ipfs dns Example Domain
Parse http://example.com into the corresponding IPFS content.
pin: Pin the object to local storage. This directive is used to pin IPFS objects (such as files or directories) to local storage to ensure that they are not cleaned by automatic garbage collection.
ipfs pin add Qmabc123
Pin the object with CID Qmabc123 to local storage.
repo: Manipulate IPFS repository. This command is used to manage the IPFS node's repository, including initialization, backup, recovery and cleanup of storage.
ipfs repo stat
Display statistical information of IPFS repository, such as occupied space, number of objects, etc.
stats: Display various operation statistics. This command is used to obtain various operational statistics of IPFS nodes, such as the number of network connections, transmission speed, etc.
ipfs stats bw
Display bandwidth usage statistics of IPFS nodes.
p2p: Perform Libp2p streaming mounting. This command is used to perform Libp2p streaming mounts on IPFS nodes for peer-to-peer communication.
ipfs p2p listen /ip4/0.0.0.0/tcp/4001
Listen on TCP port 4001 on the IPFS node for Libp2p streaming communication.
ipfs files chcid : Change the content identifier (CID) of the given path. This command is used to update the CID of the file or directory under the specified path.
ipfs files chcid /path/to/file
Change the CID of /path/to/file.
ipfs files cp : Copy any IPFS files and directories to MFS (or within MFS). This directive can be used to copy files and directories within the mutable namespace of the IPFS file system.
ipfs files cp /ipfs/Qmabc123 /mydir/file.txt
Copy the file with CID Qmabc123 to /mydir/file.txt.
ipfs files flush : Flushes data at the given path to disk. This directive is used to ensure that changes to the specified path are correctly written to disk.
ipfs files flush /path/to/file
Flushes changes to /path/to/file to disk.
ipfs files ls : List directories in the local mutable namespace. This command is used to view the list of files and directories under the specified path.
ipfs files ls /mydir
List files and subdirectories in the /mydir directory.
ipfs files mkdir : Create a directory. This directive is used to create a new directory in the local mutable namespace.
ipfs files mkdir /mydir/newdir
Create a new directory named newdir under /mydir.
ipfs files mv : Move files. This directive is used to move files or directories within the local mutable namespace.
ipfs files mv /mydir/file.txt /newdir/file.txt
Move /mydir/file.txt to /newdir/file.txt.
ipfs files read : Read the file in the given MFS. This command is used to read the contents of a file from the specified path.
ipfs files read /mydir/file.txt
Read the contents of the /mydir/file.txt file.
ipfs filesrm …: Delete Files. This command is used to delete files or directories under the specified path.
ipfs files rm /mydir/file.txt
Delete the /mydir/file.txt file.
ipfs filesstat : Display file status. This command is used to obtain file status information for a given path, such as size, mode, etc.
ipfs files stat /mydir/file.txt
Display the status information of the /mydir/file.txt file.
ipfs files write : Writes data to a mutable file in the given file system. This command is used to write data to the file at the specified path.
ipfs files write /mydir/file.txt "Hello, World!"
Change "Hello, World!"Write/mydir/file.txt file.
filestore: Manage file storage (experimental feature). This command is used to manage the file storage of the IPFS node, including viewing and cleaning files in the storage.
ipfs filestore ls
List files in storage.
id: Display information about IPFS nodes. This command is used to display detailed information about the IPFS node, including the node's unique identifier, connected peer nodes, etc.
ipfs-id
Display information about the current IPFS node.
bootstrap: Add or remove bootstrap nodes. This directive is used to add or remove the initial peer used to bootstrap the IPFS node.
ipfs bootstrap add /ip4/192.0.2.1/tcp/4001
Add /ip4/192.0.2.1/tcp/4001 as a boot node to the IPFS node.
swarm: manages connections to P2P networks. This directive is used to manage the connection between IPFS nodes and other nodes in the P2P network.
ipfs swarm peers
Lists the peers to which the current IPFS node is connected.
dht: Query DHT for values or peers. This directive is used to query the DHT (Distributed Hash Table) for IPFS-related values or peers.
ipfs dht findprovs Qmabc123
Find the peer node in DHT that provides Qmabc123 content.
ping: Measures the latency of a connection. This command is used to measure the connection latency to other nodes.
ipfs ping Qmxyz456
Measure the connection latency to the node with CID Qmxyz456.
diag: Print diagnostic information. This command is used to print diagnostic information of IPFS nodes for troubleshooting and performance analysis.
ipfs diag sys
Print system diagnostic information such as CPU and memory usage.
config: management configuration. This directive is used to manage the configuration parameters of IPFS nodes.
ipfs config --json Swarm.ConnMgr.HighWater 100
Set the Swarm.ConnMgr.HighWater configuration parameter to 100.
version: Display IPFS version information. This command is used to display the version information of the IPFS software.
ipfs version
Displays the version information of the currently installed IPFS software.
update: Download and apply go-ipfs updates. This command is used to download and apply an updated version of the go-ipfs software.
ipfs update
Download and apply the latest updates to go-ipfs software.
commands: List all available commands. This command is used to list all available IPFS commands.
ipfs commands
List all available IPFS directives.
cid: Convert and discover properties of CID. This command is used to convert and view the properties of CID (Content Identifier).
ipfs cid format Qmabc123
Convert CID Qmabc123 to different formats.
log: Manage and display logs of running daemon processes. This command is used to manage and display log information of the IPFS daemon.
ipfs log tail
Display the logs of the IPFS daemon in real time.
ipfs files cp /ipfs/$(ipfs add -Q ) "/ ": This is an example IPFS file copy command to add a local file to IPFS and copy it to the specified target name.
ipfs files cp /ipfs/Qmabc123 /backup/file.txt
Copy the file with CID Qmabc123 to /backup/file.txt.