LoginSignup
5
3

More than 5 years have passed since last update.

いっぱい動いているJavaのプロセスを種類別にカウントする

Posted at

バッチをJavaで作っていて、いろんな種類のものが多重起動しているサーバでどれがいくつ動いているかカウントしたい時ってあるかもしれませんよね?
そんな時はuniqコマンドにcオプションをつければ簡単!

$ jps | cut -f 2 -d " " | sort | uniq -c
      8 AAABatch
      1 BBBBatch
      3 CCCBatch
      1 Jps

単純にuniq -cが便利だったという話でした。。。

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