Forrest logo
back to the etcdctl tool

etcdctl:tldr:3e6ee

etcdctl: Store a key-value pair, reading the value from a file.
$ etcdctl put ${my-file} < ${filename-txt}
try on your machine

The command etcdctl put ${my-file} < ${filename.txt} is using the etcdctl tool to store a value in the etcd distributed key-value store.

Here's a breakdown of the command:

  • etcdctl: It is a command-line interface for interacting with the etcd key-value store. etcd is a distributed, consistent, and highly available key-value store used for storing shared configuration and service discovery.
  • put: It is the command used with etcdctl to store a value in the key-value store. It takes a key and a value as parameters.
  • ${my-file}: It is the key or path under which the value will be stored in the key-value store. ${my-file} is a placeholder for the actual key or path.
  • <: It is the input redirection operator that takes the content from the file specified after it and passes it as input to the command before it.
  • ${filename.txt}: It is the name of the file from which the value will be read and stored in the key-value store. ${filename.txt} is a placeholder for the actual file name.

So, in summary, the command etcdctl put ${my-file} < ${filename.txt} will read the contents of ${filename.txt} and store them with the key ${my-file} in the etcd key-value store.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the etcdctl tool