how to get linode id using the cli on windows 10 cmd prompt

hi,

I am trying to get linode-id from the list of linodes that I have on windows 10 cmd prompt.

C:\Users\parul>linode-cli linodes list
┌──────────┬────────────────┬─────────┬───────────────┬────────────────────┬─────────┬─────────────────┐
│ id │ label │ region │ type │ image │ status │ ipv4 │
├──────────┼────────────────┼─────────┼───────────────┼────────────────────┼─────────┼─────────────────┤
│ 21648848 │ ubuntu-us-west │ us-west │ g6-standard-1 │ linode/ubuntu20.04 │ ?[31moffline?[39m │ 173.255.216.222 │
│ 21705530 │ parul-api-test │ us-west │ g6-standard-1 │ linode/ubuntu20.04 │ ?[32mrunning?[39m │ 45.79.226.32 │
└──────────┴────────────────┴─────────┴───────────────┴────────────────────┴─────────┴─────────────────┘

C:\Users\parul>

I Need to get the second id.
Can someone help me with this.

2 Replies

Hi,
This is in the help somewhere, but it's a bit obscure if I remember correctly. Use this.
linode-cli linodes list --all

Good luck!
Blake

Windows command prompt is pretty convoluted when it comes to scripting.

How are you determining it's the second Linode ID you need? By name?

You could dump the output to a file and then use some of the examples here to loop through the file to get the ID.

The linode-cli tool has options to control the formatting of the output so you can limit it to the columns you need, make it comma-separated etc to make it easier to process.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct