34
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

psコマンドのインストール方法

Last updated at Posted at 2016-11-09

amazonlinuxのコンテナを使おうとしたら軽量を極めすぎててpsコマンドがなかったのでそのインストール方法

普段psをインストールしようと思うことがないのでちょっと手間取りました

install (CentOS6, AmazonLinux)

  • たぶんcentos6系は共通
# yum -y install procps
  • 確認
# rpm -q procps 
procps-3.2.8-30.14.amzn1.x86_64

入るコマンドたち

  • ps
  • top
  • vmstat
  • w
  • watch
  • kill
  • free
  • slabtop
  • skill
  • free
  • pgrep
  • pkill
  • snice
  • tload
  • pwdx
  • pmap
  • uptime
  • sysctl

install (CentOS7, AmazonLinux2)

インストール

# yum install procps-ng

確認

# rpm -q procps-ng
procps-ng-3.3.10-5.el7_2.x86_64

入るコマンドたち

  • ps
  • top
  • vmstat
  • w
  • watch
  • kill
  • free
  • slabtop
  • skill
  • free
  • pgrep
  • pkill
  • snice
  • tload
  • pwdx
  • pmap
  • uptime
  • sysctl

以下dockerの話。

imageとして保存する場合

# docker ps -a
CONTAINER ID        IMAGE                                                                  COMMAND             CREATED             STATUS                          PORTS               NAMES
b0a8823662b0        999.dkr.ecr.ap-northeast-1.amazonaws.com/amazonlinux:latest   "/bin/bash"         About an hour ago   Exited (0) About a minute ago                       dreamy_shirley

# docker commit -m "installed ps" b0 your-amazonlinux:0.1
sha256:2b0a3137be89840674cde9cf13cbe4c0813d3245db94f87b2f369ca228315919

# docker images
REPOSITORY                                                      TAG                 IMAGE ID            CREATED             SIZE
your-amazonlinux                                               0.1                 2b0a3137be89        3 seconds ago       440.7 MB
999.dkr.ecr.ap-northeast-1.amazonaws.com/amazonlinux   latest              feee9aea7094        11 days ago         328.3 MB
centos                                                          6                   f07f6ca555a5        9 weeks ago         194.6 MB

34
17
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
34
17

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?