Using the PS AUX Command in Linux (Complete Guide)
Many commands are used in Linux specifically for running processes within the Linux distributions. We can also run the ps command in Linux within the terminal. Below we will guide you on using the ps aux command and the options it provides.
Along with a guide on ps aux, we will also give you some insight into the ps command in Linux and its variables included. We will cover everything from the basics of how to prompt the ps command, what the ps command accepts, and how ps aux is implemented into the display within the Linux ps command.
-
- What is the Linux PS Command Utility?
- What Are ps Columns Compared to ps aux Columns?
- How to Use the ps aux Command in Linux
- What Does PS Do on Linux?
- What are PS Command Options?
- UNIX Style of the Linux PS Command
- What is ps for a PID? Listing Processes of PID
- Where is PID in ps aux?
- What is PPID in the ps command?
- What is STAT in ps aux command?
- What Does ps ax Mean?
- What does aux mean for WFM?
What is the Linux PS Command Utility?
The ps (Process Status) command refers to the provided utility from Linux that gives a viewpoint of information related to the process within a system. For example, this command is helpful if you want to view or manage a particular process ID within Linux, including preliminary information required for the given process.
The basic structure of the ps command statement is:
$ ps <OPTIONS>
The function of the "ps" command relies on the number of options that are supported by it, which we will cover later in more depth.
PS Command Manual
If you would like to view the manual of the ps command for more options, insert the following statement:
$ man ps
Once you insert the command correctly, something similar to this example should be displayed for you:
Although there are many other ps command guides, now you know a bit more of the basics of the ps command. With this, we can cover what the basics of the ps aux command are a reference to and how to apply them.
What Are ps Columns Compared to ps aux Columns?
First, you must understand that ps is a command different from ps aux. To use ps aux, it is essential to understand what the Linux ps command provides to use ps aux, which are the columns for ps aux.
When we activate the simple ps command, which is inserted like this:
$ ps
You will be given the columns mentioned, which will be:
-
PID. Displays the process ID of the particular running processes
-
TTY. Display of the terminal screen of the running processes association.
-
TIME. The display of time the process has consumed through your CPU usage in its execution.
-
CMD. The full command the process has spawned from.
This is only displayed when the simple ps command is launched in your process.
What are the Columns in ps aux?
To display the "AUX" in the command and what its columns provide, we will be covering the following:
-
A. The option that shows the users who are running the process
-
U. Additional information about the process
-
X. Showing that the process is not associated with any running terminal screen.
Each of these will be provided when you execute the standard default output ps aux command, which will be:
$ ps aux
When this is executed, it will provide every section, including the session leader's a, you, and x features. Overall, it will be presented as something similar to the image provided.
As you can see, many columns are applied when using the ps aux command as a full-format listing.
How to Use the ps aux Command in Linux
Suppose you are searching for how to use the ps aux command in Linux with particular features, not just the entire terminal with session leader. In that case, we are going to cover each option, such as "a" "u", and "x" and what they provide in each particular process. These unique utilities can improve your efficiency and make your operation run smoothly.
How to Use the "A" in the ps aux Command
Let's observe the output of the "a" option when implied in the command. To properly insert this command, insert the following:
$ ps a
Once this is completed, you should see the PID (Process IDs) along with the STAT column, which will indicate the state codes of the running processes. For example, the "S" process resembles the sleep process, while the "R" represents the running process.
As mentioned before, the "A" displays the process IDs and the state of the session id for every real user.
How to use the "U" output format in the ps command
The "u" output is the default display width and virtual memory format with more valuable features and gives an overall user-defined output format control setting. For this, to display this command, simply input:
$ ps u
In this output, you will provide the following columns:
-
USER. A display of the user using the process. This can also be a UID user ID number.
-
%CPU. Percentage of CPU usage by the process.
-
%MEM. Percentage of the process's resident set size to the physical memory on the machine. (non-swapped physical memory).
-
VSZ. Size of the physical memory of the virtual file occupied by the process.
-
RSS. Size of the physical memory used by the process.
-
START. The size display of when the process is being initiated.
-
COMMAND. The command that started the process.
If you are looking into viewing specific users' processes that are connected to their accounts, follow through with this command instead:
$ ps –U [Username]
This code shows each user's file access permissions for each process whose real or effective user ID identifies them. It can be handier for those looking for a specific user's effect on a process's executable file. This will also allow you to select the process based on a real user ID or name (the RUID). The Real User ID provides the user's name, while the EUID (Effective User ID) describes the user whose file access permissions are used by the process running.
How to use the "X" output format in the ps command
Running the "x" command is easy, and it should be implemented like the example given:
$ ps x
Once the command is done correctly, you should be given the following columns:
-
PID.
-
TTY.
-
STAT
-
TIME.
-
COMMAND.
Keep in mind that the operating output of "x" is similar to that of "u" with only the executable name and slight difference of the "x" displays the processes that are running without the association of any terminal screen.
What Does PS Do on Linux?
Using the ps commands in Linux allows the system to monitor the status of only running processes and shows technical details about them. This is helpful for administrative tasks and for defining each process's priorities (through virtual files).
Besides the ps aux command, the simple ps command processes many different options that can all be linked together for information regarding the running systems process. Understanding these other options and the ps aux options is important. Below we will cover some of these options in more depth in case of specific scenarios.
What are PS Command Options?
PS Command Options
Three primary options are used within the ps command that are supported such as:
-
UNIX Style Options. UNIX style is group options that typically include a "-", for example, "-aux".
-
BSD Options. These options do not require grouped characters, like "help" or "aux".
-
GNU Options. GNU always starts with a double dash "--" for example, "--deselect".
Some ps commands that are associated with the process ID could be the following:
-
-a
Displays all running processes in different formats.
-
-m
Displays the PID, time of initialization, terminal screen, and command that is being executed.
-
-t
Displaying the process of the current terminal.
-
-o
Displaying the output of the process.
-
-l
List down the processes.
-
-s
Display of the simple processes.
For more detailed options, follow through with the command below:
$ ps --help list
This will give you a more in-depth list of other useful commands to preview the process status within the Linux system.
UNIX Style of the Linux PS Command
Some basic UNIX-style commands in the Linux system are important to know when understanding the ps command. Remember that the UNIX operating system is case-sensitive and should be considered when typing the output modifiers.
Displaying a Directory
To display a directory on UNIX, follow the command below:
ls
"ls" lists the name of files within a particular directory of UNIX. This command displays the relevant files listed in your current working directory (in alphabetical order) without any qualifiers or parameters. There are other modifiers that you can also include within the "Is" command, such as:
ls -l
The command prompt "ls -l" displays a "long listing" of the files in your directory. In addition, it also provides the file name and protection information to the particular process, file owner, number of characters in the file, and additional modifiers.
ls -a
This causes all your files to be listed, including files beginning with a period, such as hidden files.
If you want to access the manual of "ls" for more information, proceed with this UNIX system prompt:
man ls
Copying Files
To copy your files, you must first type the following:
cp
This can be easily used to make copies of the files in your default directory, from one directory into another, or to copy files from other devices. Some other modifiers you can follow are also:
cp fileone filetwo
This command copies the contents of "fileone" to a file named "filetwo". Once this is completed, two files will exist.
cp /usr/neighbor/testfile .
This command is to copy the test file from the directory/user/neighbor into your UNIX account. Along with the "." indicating the file is to be copied into your current working directory.
cp ~username/file1 yourfile
This prompt copies the "file1" from the user into your UNIX account. The name of the file will be "yourfile".
Deleting and Renaming Files
If you would like to delete specific files through UNIX, continue with the command:
rm
With this command, you can also enter more files to be deleted by adding a space between each specification. An example is below:
rm newfile oldfile
If you are proceeding to rename your files, continue with the following command:
mv
"mv" allows you to change file identification (or name). To give an example, this is how renaming an "oldfile" to "newfile" as only one file will exist between the name change:
mv oldfile newfile
If you would like to create a new name and redirect it into the bin or directory, follow through with this prompt:
mv oldfile bin/newfile
This will still keep only one file in existence.
What is ps for a PID? Listing Processes of PID
If you wish to view the process from the view of the PID, run the following ps command:
ps -fp PID
For example, if your PID is "1234", the command format should be something like this:
ps -fp 1234
You will see the output display similar to this example:
Where is PID in ps aux?
When you are viewing the display, the PID is one of the primary options given on the ps aux command; here is a plain view of where it should be displayed in the output format:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.2 169820 14028 ? Ss Nov01 0:52
root 2 0.0 0.0 0 0 ? S Nov01 0:00
root 3 0.0 0.0 0 0 ? I< Nov01 0:00
root 4 0.0 0.0 0 0 ? I< Nov01 0:00
As shown, the PID is displayed closest to the USER-defined format specifiers.
What is PPID in the ps command?
PPID is the Parent Process ID, a process hierarchy, and simply the primary process of all the processes you check within the process hierarchy of the ID. These smaller processes are considered child processes. Each of these child processes also contains a Process ID.
What is the command to find the parent process ID in Linux?
If a parent process forks your process, you should probably understand the parent-child relationship as it remains pretty handy in a dead child process data situation.
If you want to view all the forked processes from the parent using bash, for example belonging to apache, execute the following command:
ps -o pid,uname,comm -C bash
The first process, owned by the root, is from the primary function of apache, while the remaining are forked processes from the parent process ID. If you want to display all child processes, continue with the command:
ps --ppid PID no.
If, for example, you had a full user id with PID number "1234", you would input the user id into the example as:
ps --ppid 1234
What is STAT in ps aux command?
As mentioned before, the STAT column displays the current status of the process according to the USER. The two most common entries are either S for sleeping or R for running. Sleeping (S) means that the process is not running or active while Running (R) is active on the CPU.
A few other entries you may come across in the stat display are:
-
D - Uninterruptible sleep (typically IO), which is in a blocked state.
-
T - Stopped by either a job control signal or it has been traced. Another process ID can restart it.
-
X - Dead Processes will display an X (although this should never be seen)
-
Z - Also called Zombie, this is the defunct process, meaning it is terminated but not terminated by the parent. The information is still available.
What Does ps ax Mean?
Running a bit differently than the regular aux command, ps ax has two representations when displayed. The "a" and the "x" represent each separate command to the ps output.
The "a" command either insists the ps display user-oriented format without the need for the "only yourself" restriction that the BSD style options typically imply. Or, it imposes the ps to list all processes with terminal systems (TTY) or all the processes in the "x" option.
The "x" command either lifts the BSD style "Must have a TTY" restriction, which is typically imposed on all ps personality settings in the BSD job control format.
In simpler terms, the "a" instructs the ps command to list the processes to the primary user and all users on the system. Similarly, the "x" includes processes not running in a terminal, such as a daemon process running elsewhere.
If you want a format that is more user friendly providing the same sources, use the command:
ps axu
This gives the current user-defined format more to view and to work with a more organized interface.
What does aux mean for WFM?
For WFM, aux means coding to observe the activity of call center agents and the time put into the company. In other words, aux in WFM is also known as Auxilary Time or Aux Codes. With this, coders or IT can have file access permissions to view the running processes for each agent.
Aux Time Guidelines
Within a call center, an agent's extra time is within the following guidelines:
-
Paid unproductive times (Meetings or CCoaching
-
Paid Productive times (Emails, Calls, Activity)
-
Unpaid Time (Lunch or Breaks)
Some may consider combining all of these times. However, this is problematic and can cause technical issues since some agents could select the wrong aux code, especially if they have targeted metrics for specific codes (like after-call work). This can officially lead to aux abuse.
Practices for Managing AUX times
Managing AUX times is pretty simple, as it can fall into some basic guidelines such as:
-
Measure, Monitor, and Coach
-
Aux Code Reports
-
Watch Agent Morale
-
Be aware of AUX abuse
Setting targets and goals with your agents while improving their morale and overall work environment makes AUX coding easier for everyone. Although even with all of these good things, aux abuse can still be active. So, what is aux abuse?
Aux abuse is also known as aux manipulation. Typically, this involves agents manipulating the codes by aux jumping or aux toggling, where agents jump between being ready for a call and aux time to put them on the bottom of the queue purposely. This is a good way of avoiding calls and gaining money without working.
What is AUX State?
When a user format logs into the ACD system, an AUX state is when agents in a call center are available to take calls. This is typically where the "STAT" code comes into play. If the process of the current user name is active or not, it will be shown within the virtual files displayed.
Frequently Asked Questions
What is the difference between ps and ps aux in Linux?
While the ps command accepts all the processes running, not only the process ids ps aux command defines the process commands of all users, including the root. Ps Aux is used by many IT and coding professionals to ensure agents are providing accurate auxiliary time.
What is ps AUX and ps EF?
"Ps aux" and "ps ef "(or -ef) are essentially the same command. Both meanings are the same and do not necessarily have any differences. The difference between "ps -ef" and "ps aux" is due to historical differences between POSIX and BSD systems. POSIX once accepted the ps -ef command, while the aux only accepted the "aux" prompt.
What can I use instead of ps in Linux?
The "procs utility" is another helpful tool instead of ps in Linux. The Procs utility does everything the ps command does while displaying more options and additional fields. This utility can sometimes be more beneficial than ps, although both have the most critical information.
How do you kill a process?
You can kill a process in Linux using the prompt "kill" or "killall". With the command "kill", you are killing a process by ID, while with the "killall" you are killing only the process " by name". If you continue with the command "kill -9" you are sending a kill signal to terminate any process running attached with a PID or process name.
What does ps aux grep do?
using "ps aux grep" allows you to customize how the tool searches for a pattern or, in some cases, multiple patterns. For example, you can select all processes except the session, process group, session leader, and processes not associated with the terminal.
What is the difference between Pgrep and ps aux?
While ps aux returns the full command line of each process running, pgrep only looks at the executable names. Meaning while grepping the ps aux output, anything proceeding in the pathway or parameters of a "binary" process will be combined.