AIXで「ps aux」を使用してPPIDを取得するには?

AIXで「ps aux」を使用してPPIDを取得するには?

私はこれが可能であることを知っていますが、ps -ef以下を使用して取得したいと思います。ps aux

どうすればいいですかAIX

ベストアンサー1

ps auxはpsのBerkeley標準です。

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.

コマンドフラグに示すように、「[l | s | u | v]」の1つだけを使用できます。

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.

「u」を「l」に置き換えることができますが、「u」にすべてのフィールドが含まれるわけではありません。

X/Open バリアントも使用できます。

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

すべてのプロセスが必要な場合は、-eを-Aに変更することもできます。 -e はカーネルプロセスを提供しませんが、-A は提供します。

-e Writes information to standard output about all processes, except kernel processes.
-A Writes to standard output information about all processes.

おすすめ記事