To understand combination of options, you need to understand the options themselves. To get a glimpse, try ps --help
. To see explanation of every option, see ps
manual (man ps
, but that's a reading for a very long evening).
There are several styles of passing options to command in Linux. It depends on the program, which style it understands. One of most common style is using single-letter options and passing them using -
(dash), when it usually does not matter on order of options (e.g. ls -a -l
is the same as ls -l -a
-- "list, a-ll items using l-ong format") and they can be concatenated to use with one dash (so ps -al
or ps -la
is still the same as above).
Besides one-letter options, there are also one-letter parameters, which need their value, which, in case of ps -u aahan
means "processes of u-ser aahan. (This is the exception to option grouping: such option has to be the last one in the group to prevent misinterpretation.)
Then there are long options like --help
, which sometimes have obvious meaning, sometimes not, but it's another story.
ps
, however, is unfortunately using some conglomerate of more styles: with the dash (command -o
, which I believe iis called "linux style") or without the dash (command o
, which I believe comes from BSD). This makes usual ps
commands look a little confusing, but once you read ps --help
, you should be able to recognize them.
To make it even more confusing, there are also several versions of ps
. (The OSX ps
has different options as Linux ps
, for example.)
Well, I use ps -A
(list all processes) most of the time, it's just because I didn't need any other yet. (Or, more probably I didn't know I needed them... :D).
My advice: Get to understand the basic ones, use them, and if ps
does not answer your question: explore, study, experiment...
– its_me Aug 05 '11 at 21:53$ ps ux, $ ps -aux, $ ps U aahan, $ ps uU aahan
ps
command (multiple versions ofps
exist but that's probably not what you are after). – jw013 Aug 05 '11 at 21:54ps
options”. You can see an example of such a question here, left over from our early days when we didn't quite realize what a mess the answers would become. – Gilles 'SO- stop being evil' Aug 05 '11 at 22:40ps au
andps aux
look up what thex
flag does in the man page. If there is something you don't understand after that, then ask here. What options you use is less about "favorites" or "frequently used" and more about what YOU need to see. – Caleb Aug 05 '11 at 22:57