Listing Names not CIDs

yatesco

Renowned Member
Sep 25, 2009
230
10
83
Hi,

i am using `lxc-attach --name CID` quite a bit bt it is getting tedious remembering the CID for the instance I want. I have given each container a memorable name (e.g. 'rclone' for the container which, you guessed it, rclones various things offsite).

Is there a magic sequence of keys that will list the CID and hostname for each container?

Thanks!
 
you probably should use 'pct' instead of the lxc-XXX binaries

e.g., 'pct enter' instead of 'lxc-attach -n'

'pct list' will give you a list of containers. 'pct help' and 'man pct' are probably also helpful for further reading ;)
 
  • Like
Reactions: yatesco
Ah `pct` is the magic source, not `lxc` - got it.

(and yes, I did `man lxc-attach` :-))