Unix, BSD and GNU long options in ps command

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 –

  1. List processes with ps command in Ubuntu and,
  2. sort ps output in Ubuntu.

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 –

  1. Unix options,
  2. GNU long options and,
  3. 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.

Unix options

If we want to list all the processes then, use -e option –

ps -e

GNU long options

We get achieve the similar outcome using GNU long options, issue the following –

ps --deselect

BSD options

Lastly, we have BSD options. We can also achieve similar results here by using this option as well –

ps x

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

man ps

In conclusion, we have discussed Unix, BSD and GNU long style options in ps command here. We move to using top command next.

Similar Posts