how to differentiate bitcoin-cli command when have testnet & mainnet both running
You can pass the -rpcport flag to bitcoin-cli to specify which node to connect to when running multiple on the same machine.