LoginSignup
5
6

More than 5 years have passed since last update.

psコマンドでソート(BSDスタイル)

Last updated at Posted at 2018-08-25

psコマンドはデフォルトではPIDの昇順で表示される。
しかし、トラブルシューティングのときなどは、CPU使用率やメモリ使用量など特定のカラムでソートして表示したい。

--sortオプションがあるのでそれを使う。

# CPU使用率の降順で表示
$ ps aux --sort -%cpu

# CPU使用率の昇順の表示("+"はなくても可)
$ ps aux --sort +%cpu 


# RSSの降順で表示
ps aux --sort -rss

# RSSの昇順で表示
ps aux --sort +rss

ソートのキーとして指定できる名前は、man psSTANDARD FORMAT SPECIFIERSを参照する。

5
6
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
5
6