bash - Alias for SSH and run command in a Vagrant VM -
i have 2 vagrant machines in folder, , i'm having ssh in both , run same command. do:
$ vagrant ssh machine1 [vagrant@machine1 ~]$ sudo rm -rf /tmp/cache/* [vagrant@machine1 ~]$ exit $ vagrant ssh machine2 [vagrant@machine2 ~]$ sudo rm -rf /tmp/cache/* [vagrant@machine2 ~]$ exit
i'd create alias or little script can run , things, don't need type again , again...
ideas?
to this, can add alias:
alias vssh="vagrant ssh machine1 -c 'sudo rm -rf /tmp/cache/*'; vagrant ssh machine2 -c 'sudo rm -rf /tmp/cache/*'"
add profile (i.e. ~/.bash_profile or similar file), reload running:
. ~/.bash_profile
Comments
Post a Comment