Optional
execOptional
extraAdditional command arguments to pass to ps
.
Defaults to null
.
These will be appended to the command after the selector and output format arguments. Use with caution, as they may conflict with other arguments.
Also, be careful to escape any argument if necessary to avoid shell injection vulnerabilities.
Optional
fieldsFields to include in the result.
Defaults to null
.
If the array is empty or not provided, all available fields will be included in the result.
Available fields are:
args
: Command and arguments.comm
: Name to be used for accounting.etime
: Elapsed time since the process was started.group
: Text name of effective group ID.nice
: The process scheduling increment (see setpriority(2)).pcpu
: The CPU utilization of the process; this is a decaying average over up to a minute of previous (real) time. Since the time base over which this is computed varies (since processes may be very young), it is possible for the sum of all %cpu fields to exceed 100%.pgid
: Process group number.pid
: Process ID.ppid
: Parent process ID.rgroup
: Text name of real group ID.ruser
: User name (from ruid).time
: Accumulated CPU time, user + system.tty
: Full name of controlling terminal.user
: User name (from uid).vsz
: Virtual size, in Kilobytes.Optional
selectorSelector to filter processes.
Defaults to "all"
.
If a string is provided, it can be:
-A
argument).-a
argument).If an object is provided, it can contain any of the following optional properties to filter processes:
group
: An array of group IDs (numbers or strings) to filter by group ID (argument: -G
).pid
: An array of process IDs (numbers) to filter by process ID (argument: -p
).tty
: An array of terminal names (strings) to filter by terminal (argument: -t
).user
: An array of user IDs (numbers or strings) to filter by user ID (argument: -U
).
Additional execution options. Defaults to
null
.These options are passed to the underlying
exec
function.