In previous two articles, we saw how we can effectively generate reports about status of processes running in our system through ps command-line utility. We are talking about following articles -
Here, we will discuss different options the ps command accepts. It is worth mentioning that, while writing this article - we write from the perspective of working on Ubuntu 22.04 release. We haven't checked for other Linux distributions.
So, the ps command mainly supports three command-line options -
- Unix options,
- GNU long options and,
- BSD options.
First, understand how these three are different from each other. Thereafter, we will show how we can utilize these to list processes with appropriate examples.
Unix options - these are preceded by a dash (-). If we want then, we may group these together.
GNU long options - these are preceded by two dashes (--).
BSD options - We generally group these together. But, these options don't require a dash.
Next, we see how we can utilize these three options.
If we want to list all the processes then, use -e option -
GNU long options
We get achieve the similar outcome using GNU long options, issue the following -
Lastly, we have BSD options. We can also achieve similar results here by using this option as well -
There are numerous combinations we can make for listing processes through each of these options. Like,
ps -ely ps aux
Note: It is not possible for us to discuss all the option combinations of ps command. Therefore, we advise you to look for man pages of ps command. We have covered the basics through multiple articles on the website. And, we hope it helps you to take things further.
To look for man pages of ps command -
In conclusion, we have discussed Unix, BSD and GNU long style options in ps command here. We move to using top command next.