# Execute Influx on CLI

**URL:** <https://community.influxdata.com/t/execute-influx-on-cli/25389>\
**Category:** InfluxDB 2\
**Created:** [June 12, 2022, 5:02pm UTC](https://community.influxdata.com/t/execute-influx-on-cli/25389 "2022-06-12T17:02:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LordSpectre](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/lordspectre/32/10331_2.png) [@LordSpectre](https://community.influxdata.com/u/LordSpectre)\
**Post date:** [June 12, 2022, 5:02pm UTC](https://community.influxdata.com/t/execute-influx-on-cli/25389/1 "2022-06-12T17:02:10Z")

</div>

Hi community,  
I’m a totally newbie on influxDB, I have an already DB installed on RHEL7 and I’m try to do some tests using the CLI.

The following command works perfect and show me the databases:  
`# influx -host x.x.x.x -execute 'SHOW DATABASES'`

The question is simple, how can I combine 2 commands like:  
`# influx -host x.x.x.x -execute 'use stat, show series'`

So just use a specif database and then show series on this DB.

Thank you

EDIT: To be more clear, what I have to do is something like:

```auto
# influx -host x.x.x.x -execute 'use stats; DELETE from status'
ERR: Database stats; DELETE from status doesn't exist. Run SHOW DATABASES for a list of existing databases.
DB does not exist!

```

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [June 14, 2022, 4:48pm UTC](https://community.influxdata.com/t/execute-influx-on-cli/25389/2 "2022-06-14T16:48:09Z")

</div>

Hello @LordSpectre,  
You would do something like:

```auto
USE stat
SHOW SERIES on stat

```

But it looks like that db doesn’t exist for you yet, so youll need to create one first.

> **[Explore your schema using InfluxQL | InfluxDB OSS 1.8 Documentation](https://docs.influxdata.com/influxdb/v1.8/query_language/explore-schema/#show-series)**
>
> Useful query syntax for exploring schema in InfluxQL.

---

<div class="post-metadata">

**Author:** ![LordSpectre](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/lordspectre/32/10331_2.png) [@LordSpectre](https://community.influxdata.com/u/LordSpectre)\
**Post date:** [June 15, 2022, 4:31am UTC](https://community.influxdata.com/t/execute-influx-on-cli/25389/3 "2022-06-15T04:31:30Z")

</div>

Thank you, the DB exists, it’s my fault, I reported the output command from other server 🙂

I used something like:  
`influx -host x.x.x.x -execute 'DELETE from status' -database="stats"`

But this is also working fine:  
`influx -host x.x.x.x -execute 'show series on stats'`

But this is not working:  
`influx -host x.x.x.x -execute 'delete from status on stats'`

Then I still don’t understand if it’s possible to concatenate two other commands in one CLI row like:

```auto
show series
DELETE from status

```

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [June 15, 2022, 8:05pm UTC](https://community.influxdata.com/t/execute-influx-on-cli/25389/4 "2022-06-15T20:05:15Z")

</div>

@LordSpectre thanks for sharing your solution and thought process
