`-f`と`-o`は `ps`でどのようにやり取りするのですか?

`-f`と`-o`は `ps`でどのようにやり取りするのですか?

-f-oどのようにやり取りするのですpsか?報道によると、彼らは一緒に働くことになっていませんでしたps:出力修飾子と出力フォーマットの制御 そしてhttps://unix.stackexchange.com/a/446198/674-fフィールドは暗黙的に指定されるため、-oユーザーはフィールドを指定できます。

man ps説明する

-f     Do full-format listing. This option can be combined with many other UNIX-style options to add additional columns.  It also causes the command arguments to be
          printed.  When used with -L, the NLWP (number of threads) and LWP (thread ID) columns will be added.  See the c option, the format keyword args, and the format
          keyword comm.

f      ASCII art process hierarchy (forest).

無関係なオプション/パラメータのようです。

しかし、なぜ

  1. ps -f -o cmdのようにps f父と息子の関係を示していますか?
  2. ps -f -o ...ps f? と同じ数のプロセスを選択します。

    $ ps f  | wc -l
    224
    $ ps -f -o pid |  wc -l
    224
    
  3. ps -f有無にかかわらず選択できるさまざまなプロセスがありますか-o

    $ ps -f  |  wc -l
    5
    
  4. -eここでは可能なようではないでしょうか?

    $ ps -e -f -o pid,ppid,comm |  wc -l
    224
    
    $ ps -e -f  |  wc -l
    414
    
    $ ps -e  -o pid,ppid,comm |  wc -l
    414
    

ありがとうございます。

ベストアンサー1

多くのpsGnu / Linuxは、System VとBSDという2つ以上のバージョンと互換性がありますps。いくつかのオプションは1つから出て、いくつかは別のオプションから来ます。

おすすめ記事