# Delete on InfluxDB from CLI

**URL:** <https://community.influxdata.com/t/delete-on-influxdb-from-cli/31729>\
**Category:** InfluxDB 2\
**Created:** [October 5, 2023, 3:00pm UTC](https://community.influxdata.com/t/delete-on-influxdb-from-cli/31729 "2023-10-05T15:00:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![adallolio](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adallolio](https://community.influxdata.com/u/adallolio)\
**Post date:** [October 5, 2023, 3:00pm UTC](https://community.influxdata.com/t/delete-on-influxdb-from-cli/31729/1 "2023-10-05T15:00:49Z")

</div>

Hi,  
I am managing my InfluxDB Cloud buckets from CLI from my laptop.  
I have followed the documentation but I am not able to delete entirely a measurement.

I have tried:

influx delete --org-id X --bucket-id Y --start 1970-01-01T00:00:00Z --stop $(date +“%Y-%m-%dT%H:%M:%SZ”) --predicate ‘\_measurement=“Temperature”’

and many other small variants of this command but none of the actually deletes the Temperature measurement from my bucket. It is still there when I query from the InfluxDB Cloud Data Explorer.

Can anybody help?

Thanks

---

<div class="post-metadata">

**Author:** ![AVVS\_Sudheer](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/avvs_sudheer/32/13075_2.png) [@AVVS\_Sudheer](https://community.influxdata.com/u/AVVS_Sudheer)\
**Post date:** [October 6, 2023, 9:11am UTC](https://community.influxdata.com/t/delete-on-influxdb-from-cli/31729/2 "2023-10-06T09:11:58Z")

</div>

Hi,

You can use the CLI command as below:

Influx bucket delete --name second.

It will delete the bucket.

---

<div class="post-metadata">

**Author:** ![adallolio](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adallolio](https://community.influxdata.com/u/adallolio)\
**Post date:** [October 6, 2023, 1:12pm UTC](https://community.influxdata.com/t/delete-on-influxdb-from-cli/31729/3 "2023-10-06T13:12:40Z")

</div>

Hi,  
I don’t want to delete the bucket, just one measurement inside the bucket.

Thanks  
Alberto

---

<div class="post-metadata">

**Author:** ![fercasjr](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@fercasjr](https://community.influxdata.com/u/fercasjr)\
**Post date:** [October 6, 2023, 7:07pm UTC](https://community.influxdata.com/t/delete-on-influxdb-from-cli/31729/4 "2023-10-06T19:07:13Z")

</div>

I use CURL to delete, and I found kind of tricky to parse the predicate because there are quotes within quotes so I usually I scape one set and use Unicode to escape the other set.

```auto
curl "http://localhost:8086/api/v2/delete?org=ORGNAME&bucket=BUCKETNAME" ^
  -H "Authorization: Token HFSHDBGHSBDFKSBDKSDKVF34351358135154653" ^
  -H "Content-Type: application/json" ^
 --data "{\"start\": \"2023-09-07T20:27:00Z\",\"stop\": \"2023-09-07T20:28:00Z\", \"predicate\": \"THISISTHETAGNAME=\u0022THISISTHEVALUE\u0022\"}"

```

\u0022 is "

---

<div class="post-metadata">

**Author:** ![adallolio](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adallolio](https://community.influxdata.com/u/adallolio)\
**Post date:** [October 7, 2023, 8:02am UTC](https://community.influxdata.com/t/delete-on-influxdb-from-cli/31729/5 "2023-10-07T08:02:11Z")

</div>

Hi, thanks, I’ll try.  
My bucked is on InfluxDB Cloud. I guess the same approach would work by just changing the URL?
