Hello Everyone,
how can I list only one container with lxc list if I have others with the same string in the beginning? I want to only show one specific container addresses by the exact name.
Example:
I dont want to list others that beginn with the same substring… If I have ‘wordpress’ and ‘wordpress-live’ and ‘wordpress-stage’ - how can I only list that one, with the name ‘wordpress’?
For completeness and robust reusability in other environments, it is worth mentioning that to have exact and complete matching, you also need to mark the beginning ^ in the regexp as follows:
lxc list ^u1$
This should ensure only one instance name is returned as the OP requested. The original solution would still return *[containername].