I want to print certain columns only from ps
output that is PID, PPID, command, memory utilization and CPU utilization columns.
when I run ps
command I get the following output.
Now I only want some columns from this output so I use -o flag as mentioned in this tutorial.
But I am getting this error.
I don’t understand where is the problem. I have also tried usin --help
and it is not showing -o
flag. So I am confused here.
I am using the windows operating system. And using Git Bash terminal to run all these Linux commands.
Advertisement
Answer
Git Bash is a terminal for Windows that emulates the Linux bash (shell) functionality. It is not 100% compatible to a “real” bash shell. As you’ve empirically seen, its ps
executable doesn’t support all the flags you’re used to from Linux. The --help
option will show you what flags are supported.