1

When I run the following command: enter image description here

I get the following output: enter image description here

But I only want to get the container specified in the command not all of them.

How can I do that?

Abdul Moiz
  • 25
  • 1
  • 8

1 Answers1

2

You can use POSIX Extended Regular Expressions:

lxc list -c n '^ubuntu$'

+--------+
|  NAME  |
+--------+
| ubuntu |
+--------+

If you don't want the formatting just use the --format csv switch, which will output just ubuntu

Lawrence Cherone
  • 46,049
  • 7
  • 62
  • 106