The “ps” command is basically the short form used for process status command, which is actually a command used in Linux. For example, you can use the same command in Linux to get all the details about all processes running in the operating system. In this article, I will explain what the “ps” command means and how to use it in detail below.
What is ps Command and How to Use It?
As mentioned above, it is very easy to use the ps command to get all the details about the processes running in your Linux operating system. The output of this command could change according to the parameters used with it. In any case, in this guide, you will learn about the basics of using the “ps” command in Linux by reading some examples given below.
By default, the ps command displays the commands that are currently used in this command prompt.
The options
- The “-x” option allows to visualize all the active processes of the current user.
- The “-ax” option allows to visualize all the processes of the machine of all the users.
- The “-aux” option allows to show all processes for all users.
- The “-u username” option displays each process associated with the user.
- The “-p PID” option displays information about a process.
The “-t” option displays all processes associated with a terminal.
The various fields
- PID – It is the unique identifier of the process which has been defined by the system.
- TTY – It indicates the port number of the terminal.
- TIME – It displays the CPU time used by this process.
- CMD – It displays the name of the command that uses this PID.
- USER – It displays the user name of the process.
- START – It displays the time at which the process started.
- %CPU – It shows the CPU usage in percentage.
- %MEM – It displays the use of RAM in percentage.
- RSS – It gives the use of physical memory used in kilobytes by the process (excluding swap).
- VSZ – It gives the use of shared libraries and the memory used for its operation.
- STAT – It displays the current state of the process, R as Run Start…
Here is the detail of the STAT field
- D – Uninterruptible from sleep
- R – Executable start
- S – Waiting for an event to complete, asleep (sleep)
- T – Stopped, either by a use command signal or because it is being traced
- W – Paging (not valid since kernel 2.6.xx)
- X – Dead
- Z – “Zombie” process.
- < – High priority
- N – Low priority
- L – Pages locked in memory
- s – Session leader
- l – Multi-threaded
- + – Is in the foreground process
That is everything you need to know about what does “ps” command mean and how to use it on Linux. For more similar types of articles, check out our other guides only on TechNClub.com: How to Install Linux on Chromebook, and How to Install and Play Diablo 2 on Linux.