0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ps

Last updated at Posted at 2024-05-16

プロセスの状態を見る

root@***********# ps aux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.3  0.3 103512 13148 ?        Ss   16:59   0:02 /sbin/init s
...
root        3911  0.0  0.0   9920  3288 pts/0    R+   17:13   0:00 ps aux

気づき

%cpu,%men, vsz,rss, tty,stat, start, timeの列の意味がわからない。
ので調べる。
まずはps auxから調べてみる

ps auxとは

DESCRIPTION
       ps displays information about a selection of the active processes.  If
       you want a repetitive update of the selection and the displayed
       information, use top(1) instead.

和訳

psは、アクティブなプロセスの選択に関する情報を表示する。 選択範囲と表示される情報を繰り返し更新したい場合は、 代わりに top(1) を使用する。

気づき

アクティブなプロセスとはなんだろう?
とりあえずプロセスの情報を表示してくれる

Note that "ps -aux" is distinct from "ps aux".  The POSIX and UNIX
       standards require that "ps -aux" print all processes owned by a user
       named "x", as well as printing all processes that would be selected by
       the -a option.  If the user named "x" does not exist, this ps may
       interpret the command as "ps aux" instead and print a warning.  This
       behavior is intended to aid in transitioning old scripts and habits.
       It is fragile, subject to change, and thus should not be relied upon.

和訳

「ps -aux」は「ps aux」とは異なる。 POSIXおよびUNIX標準では、「ps -aux 」は、「x 」という名前のユーザが所有する すべてのプロセスを表示し、-aオプションで選択されるすべてのプロセスも表示することを 要求している。 x 「というユーザーが存在しない場合、このpsはコマンドを 」ps aux "と解釈する。はコマンドを 「ps aux 」と解釈し、警告を表示する。 この この動作は、古いスクリプトや習慣の移行を支援するためのものである。これは壊れやすく、変更される可能性があるため、信頼してはならない。

気づき

ps -auxとps auxはちがう。間違えても援助はしてもらえるが頼りにしない方がいい。
と単語を調べながら和訳もした。
これから英語も読めるようにしたい。
英語読めないとだいぶきつそう。

aオプション

a      Lift the BSD-style "only yourself" restriction, which is
              imposed upon the set of all processes when some BSD-style
              (without "-") options are used or when the ps personality
              setting is BSD-like.  The set of processes selected in this
              manner is in addition to the set of processes selected by other
              means.  An alternate description is that this option causes ps
              to list all processes with a terminal (tty), or to list all
              processes when used together with the x option.

和訳

BSDスタイルの(「-」のない)オプションが使われている場合や、 psのパーソナリティ設定がBSDライクな場合に、全プロセスの集合に課されるBSDスタイルの「自分自身だけ」という制限を解除する。 この方法で選択されたプロセス集合は、他の方法で選択されたプロセス集合に追加される。 別の説明としては、このオプションは ps にターミナル (tty) を持つすべてのプロセスを一覧表示させるか、 x オプションと一緒に使われたときにすべてのプロセスを一覧表示させる。

気づき

全てのプロセスのリストまたxオプションを一緒に使った時に全てのプロセスのリストを表示させると最後に書かれている
BSDスタイルってなんだよ(だいぶ後で調べる)

xオプション

x      Lift the BSD-style "must have a tty" restriction, which is
              imposed upon the set of all processes when some BSD-style
              (without "-") options are used or when the ps personality
              setting is BSD-like.  The set of processes selected in this
              manner is in addition to the set of processes selected by other
              means.  An alternate description is that this option causes ps
              to list all processes owned by you (same EUID as ps), or to
              list all processes when used together with the a option.

和訳

BSD 形式の(「-」のない)オプションが使われている場合や、 ps personalit の設定が BSD 風になっている場合に、 全プロセスの集合に課される BSD 形式の「tty がなければならない」という制限を解除する。 この方法で選択されたプロセス集合は、他の方法で選択されたプロセス集合に追加される。 別の説明としては、このオプションを指定すると、ps が所有するすべてのプロセス(ps と同じ EUID)を一覧表示する。オプションと併用すると、すべてのプロセスを一覧表示する。

気づき

ttyを持っていなければならないという制限を取っ払うものらしい。
ほとんどaオプションと英文が同じだ。

OUTPUT FORMAT CONTROL
       These options are used to choose the information displayed by ps.  The
       output may differ by personality.

      u      Display user-oriented format.

和訳

出力フォーマット制御
これらのオプションは、psによって表示される情報を選択するために使用される。 出力は性格によって異なるかもしれない。

u ユーザー指向の書式を表示する。

気づき

psで表示された情報を選ぶのにこれらのオプションが使われる
uはユーザーが見やすいように表示されるか。

STATとは

PROCESS STATE CODES
       Here are the different values that the s, stat and state output
       specifiers (header "STAT" or "S") will display to describe the state
       of a process:

和訳

以下は、s、statおよびstate出力指定子(ヘッダー 「STAT 」または 「S」)がプロセスの状態を表すために表示するさまざまな値である:

気づき

プロセスの状態を識別子を使って表示してくれるのか

識別子

               D    uninterruptible sleep (usually IO)
               I    Idle kernel thread
               R    running or runnable (on run queue)
               S    interruptible sleep (waiting for an event to complete)
               T    stopped by job control signal
               t    stopped by debugger during the tracing
               W    paging (not valid since the 2.6.xx kernel)
               X    dead (should never be seen)
               Z    defunct ("zombie") process, terminated but not reaped by
                    its parent

       For BSD formats and when the stat keyword is used, additional
       characters may be displayed:

               <    high-priority (not nice to other users)
               N    low-priority (nice to other users)
               L    has pages locked into memory (for real-time and custom
                    IO)
               s    is a session leader
               l    is multi-threaded (using CLONE_THREAD, like NPTL pthreads
                    do)
               +    is in the foreground process group

vszとは

vsz         VSZ       virtual memory size of the process in KiB
                             (1024-byte units).  Device mappings are
                             currently excluded; this is subject to change.
                             (alias vsize).

和訳

KiB(1024バイト単位)のプロセスの仮想メモリ・サイズ。 現在のところ、デバイスマッピングは除外されています。(vsizeの別名)。

気づき

プロセスの仮想メモリサイズを表示させる

デバイスマッピングとは

RDM は別個の VMFS ボリュームにあるマッピングファイルであり、Raw 物理ストレージ デバイスのプロキシとして機能します。RDMがあることで、仮想マシンはストレージ デバイスに直接アクセスして、ストレージデバイスを使用することができます。RDM には、物理デバイスへのディスク アクセスを管理およびリダイレクトするためのメタデータが格納されています。

このファイルを使用すると、VMFS 内の仮想ディスクを利用することができると同時に、物理デバイスに直接アクセスできます。したがって、このファイルによって VMFS の管理性と Raw デバイス アクセスとが結合されます。

出典

感想

とりあえず調べればpsの内容は出てきそうだ。

出典

man ps

和訳

deep l

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?