学习Linux命令rsh

名称

rsh-remote shell

概要

rsh [ - Kdnx ] [ - l username ] host [command]

描述

Rsh主机上执行命令

Rsh将其标准输入复制到远程命令,将远程命令的标准输出复制到其标准输出,并将远程命令的标准错误复制到其标准错误。 中断,退出和终止信号传播到远程命令; 当远程命令执行时, rsh通常会终止。 选项如下:

-d

-d选项在用于与远程主机通信的TCP套接字上打开套接字调试(使用setsockopt(2))。

-l

默认情况下,远程用户名与本地用户名相同。 -l选项允许指定远程名称。

-n

-n选项重定向来自特殊设备/ dev / null的输入(参见本手册页的Sx BUGS部分)。

如果未指定命令 ,则将使用rlogin(1)在远程主机上登录。

未引用的Shell元字符在本地机器上解释,而引用的元字符在远程机器上解释。 例如,该命令

rsh otherhost cat remotefile >> localfile

将远程文件remotefile附加到本地文件localfile中

rsh otherhost cat remotefile“>>”other_remotefile

remotefile附加到other_remotefile