Forrest logo
back to the pssh tool

pssh:tldr:c685f

pssh: Run a command on two hosts, and print its output on each server inline.
$ pssh -i -H "${host1} ${host2}" ${hostname -i}
try on your machine

The command you provided (pssh -i -H "${host1} ${host2}" ${hostname -i}) seems to use the pssh tool to execute a command on multiple remote hosts simultaneously.

Here is a breakdown of the command:

  • pssh: It is a command-line tool that stands for "parallel ssh" and is used for executing commands on multiple remote hosts.
  • -i: This option is used to run the command interactively, typically for commands that require user input.
  • -H "${host1} ${host2}": The -H option specifies the hostnames or IP addresses of the remote hosts on which the command should be executed. In this case, it seems that the variables host1 and host2 hold the hostnames or IP addresses.
  • ${hostname -i}: This is likely a command substitution, where the output of hostname -i command gets substituted. The hostname -i command is used to retrieve the IP address of the local machine or the hostname. So, the IP address or hostname will replace ${hostname -i} in the command.

To summarize, the command executes an interactive command on multiple remote hosts specified by ${host1} and ${host2}, and the actual command executed could depend on the value substituted in place of ${hostname -i}.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the pssh tool