gpt4 book ai didi

linux - 使用 lxc/lxd-list 命令获取特定容器

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:37:07 25 4
gpt4 key购买 nike

当我运行以下命令时: enter image description here

我得到以下输出: enter image description here

但我只想获取命令中指定的容器而不是所有容器。

我该怎么做?

最佳答案

您可以使用 POSIX 扩展正则表达式:

lxc list -c n '^ubuntu$'

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

如果您不想格式化,只需使用 --format csv 开关,它将只输出 ubuntu

关于linux - 使用 lxc/lxd-list 命令获取特定容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47695982/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com