Before I get started, it’s important to note that the Linux ps command supports a --sort argument, and that argument takes a number of key values, and those keys indicate how Last updated: July 31 2016 Linux ps command FAQ: Can you share some examples of how to sort the ps command? t ttylist Select by tty. The effective group ID describes the group whose file access permissions are used by the process. http://chatflow.net/cpu-usage/linux-check-cpu-usage-of-a-process.html
Identical to -N. -e Select all processes. p pidlist Select by process ID. g Really all processes, even session leaders. The POSIX and UNIX standards require that "ps -aux" print all processes owned by a user named "x", as well as printing all processes that would be selected by the -a
This selects the processes whose executable name is given in cmdlist. -G grplist Select by real group ID (RGID) or name. alvin alexander more linux file commands cat cd chmod chown cp df du file ls mkdir more mv pwd rm wc search commands find grep GNU long options, which are preceded by two dashes ("--"). Options: Process Selection By List These options accept a single argument in the form of a blank-separated or comma-separated list, and they can be used multiple times.
Here's a quick look at the --sort information from the ps command man page: --sort spec specify sorting order. Nearly identical to -t and --tty, but can also be used with an empty ttylist to indicate the termin The real group ID identifies the group of the user who created the process. -g grplist Select by session OR by effective group name. How To Check Cpu Utilization In Unix For A Process Identical to -p and p. --ppid pidlist Select by parent process ID.
See the -s and --group options. --Group grplist Select by real group ID (RGID) or name. Sure. This selects the processes with a session ID specified in sesslist. --sid sesslist Select by session ID. Identical to the t option without any argument.
That is, it selects processes that are children of those listed in pidlist. -s sesslist Select by session ID. How To Check Which Process Is Using More Cpu In Linux Output is unsorted by default. It displays the process ID (pid=PID), the terminal associated with the process (tname=TTY), the cumulated CPU time in [DD-]hh:mm:ss format (time=TIME), and the executable name (ucmd=CMD). This flag is obsolete and may be discontinued in a future release.
This selects the processes with a parent process ID in pidlist. Identical to -A. Linux Cpu Usage Per Process The use of BSD-style options will also change the process selection to include processes on other terminals (TTYs) that are owned by you; alternately, this may be described as setting the Linux Get Cpu Usage Of Process You can override this with the PS_FORMAT environment variable.
It is normally implied by the a flag, and is only useful when operating in the SunOS4 personality. -N Select all processes except those that fulfill the specified conditions (negates the http://chatflow.net/cpu-usage/c-get-cpu-usage-of-process.html The -g option is often an alternative to --group. An alternate description is that this option causes ps to list all processes with a terminal (tty), or to list all processes when used together with the x option. -A Select By default, ps selects all processes with the same effective user ID (euid=EUID) as the current user and associated with the same terminal as the invoker. Ps Pcpu
Note that "ps -aux" is different than "ps aux". This documentation describes a version of ps common to many distributions of Linux. This selects the processes whose real group name or ID is in the grplist list. this content Options of different types may be freely mixed, but might cause conflicts.
Identical to -e. -a Select all processes except both session leaders and processes not associated with a terminal. -d Select all processes except session leaders. --deselect Select all processes except those Linux Top Cpu Usage Identical to -p and --pid. -p pidlist Select by PID. Identical to -G. --group grplist Select by effective group ID (EGID) or name.
These effects are not considered when options are described as being "identical" below, so -M will be considered identical to Z and so on. r Restrict the selection to only running processes. The set of processes selected in this manner is in addition to the set of processes selected by other means. Troubleshooting High Cpu Utilization In Linux The set of processes selected in this manner is in addition to the set of processes selected by other means.
Identical to --deselect. If the user named "x" does not exist, ps may interpret the command as "ps aux" instead and print a warning. Options which select processes by list are as follows: -123 Identical to "--pid 123". 123 Identical to "--pid 123". -C cmdlist Select by command name. http://chatflow.net/cpu-usage/top-cpu-consuming-process-in-linux.html x Lift the BSD-style "must have a tty" restriction, which is imposed upon the set of all processes when some BSD-style (without "-") options are used or when the ps personality
For example: ps -p "1 2" -p 3,4 ...is a valid command. The default selection is discarded, and then the selected processes are added to the set of processes to be displayed. An alternate description is that this option causes ps to list all processes owned by you (same EUID as ps), or to list all processes when used together with the a Identical to -s.
Group ID numbers will work only when some group names are also specified.