FindProcesses
Previous Topic  Next Topic 

::InstallAPI::FindProcesses


Find a list of processes on the target system.


Technical Detail

The API uses the system 'ps' command to find processes.  The arguments to ps are manipulated based on the version of ps and what options it supports.



Supported Platforms

All



Returns

A list of process IDs (pids) that match the given criteria.  Passing no arguments will return a list of all pids.  If no processes are found, an empty string is returned.



Options


-glob <yes or no> (Windows only)

If this option is specified, the -name option will be matched as a glob pattern instead of an exact match.


-group <group name or ID>

Find a list of processes running for the given group name or ID.  This option does nothing on Windows platforms.


-name <command name>

Find a list of processes that match the given command name.  This does not include paths, only the actual command name.


-pid <process id>

Find the explicit process ID given.  This is useful if you want to find out if a given process ID is running.  If the pid is not found, FindProcesses will return an empty string.


-user <user name or ID>

Find a list of processes running for the given user name or ID.



Example


The following example would find the running process for the gnome-panel.


::InstallAPI::FindProcesses -name gnome-panel


This example would find all processes being run by the root user.


::InstallAPI::FindProcesses -user root