[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 4

on Command


Executes commands on remote systems.


/usr/bin/on [ -i ] [ -d ] [ -n ] Host Command [ Argument ... ]


The on command executes commands on other systems in an environment that is similar to the one running the program. The on command passes the local environment variables to the remote machine, thus preserving the current working directory. When using the on command, both users must have the same user identification. Relative path names work only if they are within the current file system. Absolute path names can cause problems since commands are issued at one machine and executed on another.

The standard input is connected to the standard input of the remote command. The standard output and standard error from the remote command are sent to the corresponding files for the on command. The root user cannot execute the on command.

Attention: When the working directory is remotely mounted over the Network File System (NFS), the Ctrl-Z key sequence causes the window to hang.


-d Specifies debug mode. Displays status messages as work progresses.
-i Specifies interactive mode. Uses remote echoing and special character processing. This option is needed for programs that expect to be talking to a terminal. All terminal modes and window size changes are increased.
-n Specifies no input. This option causes the remote program to get an end-of-file (EOF) message when it reads from standard input. This flag is necessary when running commands in the background with job control.


To execute the ls -al command on another machine and display the in-progress status messages on your terminal, enter:
on -d zorro ls -al

In this example, the on command executes the ls command on a workstation named zorro.


  Lists the directories that the server can export.
  Defines how the inetd daemon handles Internet service requests.

Related Information

The rexd daemon.

Network File System (NFS) Overview for System Management in AIX 5L Version 5.1 System Management Guide: Communications and Networks.

List of NFS Commands.

[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]