

A group leader is the first member of a group of related processes. The -a option tells ps to list the processes of all users on the system rather than just those of the current user, with the exception of group leaders and processes not associated with a terminal. This information is generally only useful on a multi-user network.Ī common and convenient way of using ps to obtain much more complete information about the processes currently on the system is to use the following: TTY (which now stands for terminal type but originally stood for teletype) is the name of the console or terminal (i.e., combination of monitor and keyboard) that the user logged into, which can also be found by using the tty command. CMD is the name of the command that launched the process. TIME is the amount of CPU (central processing unit) time in minutes and seconds that the process has been running. The four items are labeled PID, TTY, TIME and CMD. ps itself is a process and it dies (i.e., is terminated) as soon as its output is displayed. A shell is a program that provides the traditional, text-only user interface in Unix-like operating systems for issuing commands and interacting with the system, and it is bash by default on Linux. When ps is used without any options, it sends to standard output, which is the display monitor by default, four items of information for at least two processes currently on the system: the shell and ps. Every process is assigned a unique PID by the system. Those are not standard but are pretty common, and much more reliable to use than processing the output of ps.The ps (i.e., process status) command is used to provide information about the currently running processes, including their process identification numbers (PIDs).Ī process, also referred to as a task, is an executing (i.e., running) instance of a program. In scripts, I'd recommend sticking to the POSIX syntax (avoiding optional features).Īnd for searching for processes based on some criteria including command line, use pgrep ( pkill to kill them). ps -A -o pid= -o args=īeware not all systems support the same list of fields. Standardly, you also have the option of specifying the fields you want: ps -A -o pid -o argsįor instance for just the pid and command line (technically, the list of arguments passed to the last command the process executed though on many systems, processes can also change that arbitrarily) of All processes.
#WHAT IS PS EF COMMAND FULL#
On some systems including older versions of Linux, the command line is truncated by the system itself, so you can't easily get it in full if it's very large. Whether ps -ef will truncate or not the command line depends very much on the system, system version and implementation and version of ps and whether the output is going to a terminal or not. The man page on your system will give you all the details of what the various flags mean. The procps ps implementation typically found on Linux-based systems tries to conciliate all those different (and often incompatible) syntaxes, the SysV one, the BSD one, and even more like from HP/UX or AIX, so supports most syntaxes excepts in the cases where one conflicts with another. a for all processes (not just the ones associated with the current terminal), u for user oriented output to include additional information, x to also include processes not associated with any terminal (Research Unix v3 where ps first appeared already had -x for that).

Ps aux would be the BSD syntax, from the more academic systems based on the original version of Unix developed by AT&T research (Bell Labs). The closest POSIX equivalent would be ps -A -o user,pid,ppid,tty,time,args (missing the C (CPU) column).

It's specified by POSIX but only under the XSI option (which corresponds to the X/Open specification which was an effort to bring some form of standardisation for SysV-based systems, now merged into POSIX). Or the SysV syntax if you like though ps -ef was already in SysIII in 1980. Ps -ef is the syntax to get information every process with a fuller-format listing on Unices based on AT&T's Unix Support Group (USG), the part of AT&T that was commercialising Unix. There are and have been different flavours for historical reasons.
