5

I know it is possible with ps -ef but I want to get it with the command: ps aux

How to do it on AIX?

6

ps aux is the berkley standard of ps.

ps [ a ] [ c ] [ e ] [ ew ] [ eww ] [ ewww ] [ g ] [ n ] [ w ] [ x ] [ l | s | u | v ] [ t tty ] [ X ] [ ProcessNumber ]

a = Displays information about all processes with terminals (ordinarily only the own processes of the user are displayed).
u = Displays user-oriented output. This includes the USER, PID, %CPU, %MEM, SZ, RSS, TTY, STAT, STIME, TIME, and COMMAND fields.
x = Displays processes without a controlling terminal in addition to processes with a controlling terminal.

as you can see in the command flags, you can only use one of these: "[ l | s | u | v ]"

l = Displays a long listing having the F, S, UID, PID, PPID, C, PRI, NI, ADDR, SZ, PSS, WCHAN, TTY, TIME, and CMD fields.
s = Displays the size (SSIZ) of the kernel stack of each process (for use by system maintainers) in the basic output format. This value is always 0 (zero) for a multi-threaded process.
u = Displays user-oriented output. This includes the USER, PID, %CPU, %MEM, SZ, RSS, TTY, STAT, STIME, TIME, and COMMAND fields.
v = Displays the PGIN, SIZE, RSS, LIM, TSIZ, TRS, %CPU, %MEM fields.

You can replace the 'u' with the 'l', although you won't have all the fields you will have in the 'u'.

you can also use the X/Open variant:

ps -ef -o "ruser pid ppid pcpu pmem vsz rssize tty stat start time command"

you can also change -e to -A if you want all processes. -e doesn't give you kernel processes, -A does.

-e Writes information to standard output about all processes, except kernel processes.
-A Writes to standard output information about all processes.
  • should be ps -e -o "uid pid ppid pcpu pmem vsz rssize tty stat start time command" , remove the option -f – river Nov 2 '18 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.