Compartir a través de


Rexec

Runs commands on remote computers running the Rexec service (daemon). The rexec command authenticates the user name on the remote computer before executing the specified command. Windows XP and Windows 2000 do not provide the Rexec service. Used without parameters, rexec displays help.

Syntax

rexec [Host] [-l UserName] [-n] [Command]

Parameters

Host   : Specifies the remote host (computer) on which to run Command by IP address or name.

-l   UserName   : Specifies the user name on the remote computer. If omitted, the user name of the user who is currently logged on is used.

-n   : Redirects the input of rexec to the NUL device. This prevents the display of the command results on the local computer.

Command   : Specifies the command to run on the remote computer.

/?   : Displays help at the command prompt.

Remarks

  • Standard operation

    The rexec command prompts the user for a password and authenticates the given password on the remote computer. If the authentication succeeds, the command is run.

    The rexec command copies standard input to the remote command, standard output of the remote Command to its standard output, and the standard error of the remote command to its standard error. The rexec normally quits when the remote command quits.

  • Using Redirection symbols

    for redirection to occur on the remote computer, enclose redirection symbols in quotation marks (for example, ">>"). If you do not use quotation marks, redirection occurs on the local computer. For example, the following command appends the remote file RemoteFile to the local file LocalFile:

    rexec othercomputer cat remotefile >> localfile

    The following command appends the remote file RemoteFile to the remote file OtherRemoteFile:

    rexec othercomputer cat remotefile ">>" otherremotefile

  • Using interactive commands

    You cannot run most interactive commands. For example, vi or emacs cannot be run by using rexec. You can, however, use telnet instead.

  • This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections

Examples

To execute the telcon command on the remote computer vax1 using the name admin1, type the following command:

rexec vax1 -l admin1 telcon

Formatting legend

Format

Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Rexec

Using command redirection operators

Command-line reference A-Z