I am having multiple ssh commands to do some tasks for me. For eg:
ssh a-vm "rm -f /home/dir/file1.xlsx"
ssh a-vm "rm -f /home/dir/file2.xml"
scp me@b-vm:/somedir/file1.xlsx .
scp me@b-vm:/somedir/file2.xml .
1) Is there a way to combine 2 ssh commands into 1 and two scp commands into 1? 2) Is there a cost if I do ssh and scp multiple times instead of 1 time?
Any help is appreciated.