Version v3.6-DRAFT of the documentation is in DRAFT status. For the latest stable documentation, see v3.5.
How to delete keys
Describes a way to delete etcd keys
Prerequisites
- Install
etcd
andetcdctl
Add or delete keys
del
to remove the specified key or range of keys:
etcdctl del $KEY [$END_KEY]
Options
--prefix[=false]: delete keys with matching prefix
--prev-kv[=false]: return deleted key-value pairs
--from-key[=false]: delete keys that are greater than or equal to the given key using byte compare
--range[=false]: delete range of keys without delay
Options inherited from parent commands
--endpoints="127.0.0.1:2379": gRPC endpoints
Examples
etcdctl --endpoints=$ENDPOINTS put key myvalue
etcdctl --endpoints=$ENDPOINTS del key
etcdctl --endpoints=$ENDPOINTS put k1 value1
etcdctl --endpoints=$ENDPOINTS put k2 value2
etcdctl --endpoints=$ENDPOINTS del k --prefix
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.