As described in the rlogin article, the rsh protocol is not secure for network use, because it sends unencrypted information over the network, among other reasons. Some implementations also authenticate by sending unencrypted passwords over the network. rsh has largely been replaced with the secure shell (ssh) program, even on local networks.
As an example of rsh use, the following executes the command mkdir testdir as user remoteuser on the computer host.example.com running a UNIX-like system:
rsh -l remoteuser host.example.com "mkdir testdir"
After the command has finished rsh terminates. If no command is specified then rsh will log in on the remote system using rlogin. The network location of the remote computer is looked up using the Domain Name System.