Specifically I am looking for any CLI commands that can do the job.Two VM’s exist on a server both are red hat linux based.Thank you
While the best way would be to use the network, like SSH, SCP, rysnc or NFS, there are ways to share files at the virtual host level between 2 VMs. However, this is typically harder to configure and more prone to errors. I would suggest a network approach for all but special use cases.
In VMware for example, you can setup a virtual disk and share it to the two VMs. However, you need to be very careful with how you do this – because most OSes will expect to have their own disk and have full control over it, and might behave unexpectedly when another VM modifies that disk.
Protocols like NFS take care of this for you, and NFS is a lot cleaner solution for this problem.