[TUTORIAL] One liner alias to ssh into running containers from host (linux)

leodom

Renowned Member
Jul 25, 2015
10
1
68
Moorea Island
Since I got bored of having to type pct enter xxx each time,
I added an alias in .bashrc :
Bash:
alias p='PS3=" Which VM ? " ; select vm in $(pct list | grep running | sort -n | tr -s '\'' '\'' |  cut -d " " -f1,3 | tr '\'' '\'' .) ; do pct enter ${vm:0:3} ; break ; done'
Now, when I press p, I am presented with a numbered sorted list of all running containers to choose from :)
 
Thanks for sharing that. I marked the thread as tutorial.
 
  • Like
Reactions: leodom