Skip to content

Commit

Permalink
Sync from etcd-io/website@e02a91c by PCIT
Browse files Browse the repository at this point in the history
  • Loading branch information
khs1994 committed Mar 20, 2024
1 parent 13539ad commit c59406b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tutorials/how-to-delete-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ description: Describes a way to delete etcd keys
weight: 400
---

## Prerequisites

* Install [`etcd` and `etcdctl`](https://etcd.io/docs/v3.5/install/)

## Add or delete keys

`del` to remove the specified key or range of keys:

```bash
etcdctl del $KEY [$END_KEY]
```

### Options

```bash
--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

```bash
--endpoints="127.0.0.1:2379": gRPC endpoints
```

### Examples

![04_etcdctl_delete_2016050601](https://storage.googleapis.com/etcd/demo/04_etcdctl_delete_2016050601.gif)

```shell
Expand Down
27 changes: 27 additions & 0 deletions tutorials/how-to-watch-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,35 @@ weight: 600
---


## Prerequisites

* Install [`etcd` and `etcdctl`](https://etcd.io/docs/v3.5/install/)

## Watching keys
`watch` to get notified of future changes:

```bash
etcdctl watch $KEY [$END_KEY]
```

### Options

```bash
-i, --interactive[=false]: interactive mode
--prefix[=false]: watch on a prefix if prefix is set
--rev=0: Revision to start watching
--prev-kv[=false]: get the previous key-value pair before the event happens
--progress-notify[=false]: get periodic watch progress notification from server
```
### Options inherited from parent commands
```bash
--endpoints="127.0.0.1:2379": gRPC endpoints
```
### Examples
![06_etcdctl_watch_2016050501](https://storage.googleapis.com/etcd/demo/06_etcdctl_watch_2016050501.gif)
```shell
Expand Down

0 comments on commit c59406b

Please sign in to comment.