harumaki.net

インフラ屋の覚書や、ラーメン食べある記とか。

bash GNU/Linux infra

サーバ運用でよく使うスクリプト(netstat)

投稿日:2008年5月17日

Last Updated on 2013年6月7日 by かんりにん

最近ご無沙汰なのでシェルの書式を忘れてきた…ということで自分用に備忘録。

– netstatでステータスが”ESTABLISHED”のセッションを一覧表示し、1秒更新。毎回実行結果をクリアしとく。

 $ while true ; do netstat -t | grep ESTABLISHED ; sleep 1 ; clear ; done

– おなじく指定したプロセスの数を取得、1秒おきに更新。こちらはクリアしない。

 $ while true ; do ps -aef | grep httpd | wc -l ; sleep 1 ; done



-bash, GNU/Linux, infra
-

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA


関連記事

no image

[Juniper]SRX ssh公開鍵認証でログイン

LinuxサーバーへdailyでSRXのコンフィグをバックアップするべく、tftpサーバーを設定しようと思ったら どうやらtftpらしきものがないので、sshでリモートコマンドを使ってコンフィグをとっ …

no image

[パッケージ管理]porgのインストール

[pukiwiki] テスト環境にpacoを入れておこうと、久々に本家サイトへアクセスしたら “This project is no longer active.”とのこと。あ …

no image

hddtemp

[pukiwiki] *hddtempのテスト [#n8a8481e] **インストール [#bfaf0782] yumでお手軽に。環境はCentOS5.6です。 # yum install hddt …

no image

opensshにてfingerprint確認を省略する設定

[pukiwiki] // tag // ssh openssh // fingerprint // Are you sure you want to continue connecting // k …

no image

[MySQL] ZRM(Zmanda Recovery Manager) コマンドをいろいろ

“Zmanda Recovery Manager / ZRM”のRPM版にて一緒にインストールされるコマンドをいろいろ探ってみたので、メモをいろいろと。 ▼参考:お世話になって …