Scroll to navigation

PEXEC(1) User Commands PEXEC(1)


pexec - executing commands in parallel


pexec [options] [-c|-m] [--] command [arguments] | 'compound command'


Execute commands or shell scripts in parallel on a single host or on remote hosts using a remote shell.


General options:

Gives general summary about the command line options.
Gives a detailed list of command line options.
Gives some version information about the program.
Full path (e.g. /bin/sh) of the shell or interpreter to be used for script execution.
Use the specified shell to interpret the command(s) instead of direct execution.
Allow multiple individual shell command scripts to be executed in parallel with the variation of the parameters.
Name of an environmental variable which is set to the respective parameter before each execution.
The maximal number of processes running simultaneously. The <number> itself can even be a complex specification of remote hosts (see documentation for more details).
The control port of a hypervisor daemon (full path of a UNIX socket or an INET host specification).
The single-argument form of main parameter list.
The multiple-argument form of the main parameter list.
The main parameter list file.
The column index from where the parameters should be taken if they are read from a parameter file.
Threat the whole line as a single parameter if the parameters are read from a file.
Sets the scheduling priority of pexec and all children (executed processes) to the priority defined by this nice value.
A marker after which the command to execute begins.

Redirecting standard input, output and error:

The (optionally formatted) name of the input file which is used for redirecting the standard input.
The (optionally formatted) name of the output file which is used for redirecting the standard output.
The (optionally formatted) name of the output error file, which is used for redirecting the standard error.
Equivalent to specifying --output -, --error - and --input /dev/null.
The format of the final standard output redirection if the output of all of the processes are gathered into the same file.
The same final redirection format for the standard error.
Disable automatic newlines after the output and error formats.

Execution using remote hosts:

The name or full path of the remote shell to be used for building the tunnel between the local and the peer host(s). Default: ``/usr/bin/ssh''.
The full path of the pexec program on the remote hosts. If this option is omitted, pexec tries to figure out from the invoking syntax and/or the current path.
Internal use only (pexec will start in tunnel daemon mode).

Remote control, mutual exclusions and atomic command execution:

This option lets pexec to be remote controlled via INET or UNIX domain sockets.
This option overrides the default environment name PEXEC_REMOTE_PORT to the specified value, which is used by the ``-p|--connect auto'' combination to determine the control socket with which the running pexec instance can be controlled.
Used to remote control and/or poll the status of other running instances of pexec.
Remote control port to connect to.
Prints the actual status of the running jobs in a human-readable form.
Locks the specified mutex (if the mutex is not locked by someone else, otherwise it will block until the mutex is released).
Unlocks the specified mutex.
Name of the mutex.
Dump the content of the given file to standard output, if ``-m|--mutex'' is given, this will be atomic.
Save the content of standard input to the given file, if ``-m|--mutex'' is given, this will be atomic.
Execute the given command. If ``-m|--mutex'' is given, the exectution is going to be atomic with respect to that mutex.

Hypervisor mode:

Starts pexec in hypervisor mode.
The control port used by the hypervisor.
Use load also to limit the number of simultaneous processes with the specified load average interval (0, 1 or 2, or 1min, 5min or 15min, respectively).
First in first out queue processing.
Last in first out (stack) queue processing (default).


The name of the log file.
The logging level.
Increase the log level by one.


Report bugs to <>


Copyright © 2007, 2008-2009; Pal, Andras <>

This is free software. You may redistribute copies of it under the terms of the GNU General Public License <>. There is NO WARRANTY, to the extent permitted by law.

This software was written by Andras Pal. The core part was written while working for the Hungarian-made Automated Telescope (HAT) project to make the data processing more easier and therefore find many-many extrasolar planets. See more information about this project: Another internal libraries (e.g. numhash.[ch]) were primarily written for other projects.


The full documentation for pexec is maintained as a Texinfo manual. If the info and pexec programs are properly installed at your site, the command

info pexec

should give you access to the complete manual.

August 2019 pexec 1.0rc8 (2009.07.02)