内容へ移動
fl8 Wiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
Dokuwiki.fl8.jp
»
02_freebsd
»
80_Unixコマンド
»
ps でgrepについて
トレース:
02_freebsd:80_unixコマンド:ps_grep
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== ps でgrepについて ====== 新しい発見をしたのでメモ 今までは、ps でgrep を行う時に、grep自身を「grep -v grep」で省いてたが、一発で表示する方法 ===== 方法 ===== grepする文字の1文字目を[]で囲むことで、「grep -v grep」しなくてもgrep自身を省く事ができます。 <code> # ps auxw | grep [h]ttp root 23531 0.0 1.1 256620 11448 ? Ss Jun11 0:02 /usr/sbin/httpd apache 30234 0.0 0.7 257644 7592 ? S 12:23 0:00 /usr/sbin/httpd apache 30557 0.0 0.7 257644 7624 ? S 12:36 0:00 /usr/sbin/httpd apache 31189 0.0 0.7 257644 7560 ? S 13:08 0:00 /usr/sbin/httpd apache 31665 0.0 0.7 257644 7500 ? S 13:32 0:00 /usr/sbin/httpd apache 31678 0.0 0.7 257644 7508 ? S 13:33 0:00 /usr/sbin/httpd apache 31702 0.0 0.7 257644 7404 ? S 13:35 0:00 /usr/sbin/httpd apache 31961 0.0 0.7 257644 8144 ? S 13:51 0:00 /usr/sbin/httpd apache 31962 0.0 0.7 257644 7488 ? S 13:51 0:00 /usr/sbin/httpd apache 31963 0.0 0.7 257644 7496 ? S 13:51 0:00 /usr/sbin/httpd apache 31965 0.0 0.7 257644 7500 ? S 13:51 0:00 /usr/sbin/httpd </code> ===== 旧方法 ===== grep自身が表示されるので、正確なデータを取得する場合は、「grep -v grep」を入れる必要がある。 <code> # ps auxw | grep http root 23531 0.0 1.1 256620 11448 ? Ss Jun11 0:02 /usr/sbin/httpd apache 30234 0.0 0.7 257644 7592 ? S 12:23 0:00 /usr/sbin/httpd apache 30557 0.0 0.7 257644 7624 ? S 12:36 0:00 /usr/sbin/httpd apache 31189 0.0 0.7 257644 7560 ? S 13:08 0:00 /usr/sbin/httpd apache 31665 0.0 0.7 257644 7512 ? S 13:32 0:00 /usr/sbin/httpd apache 31678 0.0 0.7 257644 7508 ? S 13:33 0:00 /usr/sbin/httpd apache 31702 0.0 0.7 257644 7404 ? S 13:35 0:00 /usr/sbin/httpd apache 31961 0.0 0.7 257644 8148 ? S 13:51 0:00 /usr/sbin/httpd apache 31962 0.0 0.7 257644 7504 ? S 13:51 0:00 /usr/sbin/httpd apache 31963 0.0 0.7 257644 7496 ? S 13:51 0:00 /usr/sbin/httpd apache 31965 0.0 0.7 257644 7500 ? S 13:51 0:00 /usr/sbin/httpd root 32167 0.0 0.0 65400 840 pts/0 S+ 14:00 0:00 grep http </code> {{tag>Unixコマンド 標準}}
02_freebsd/80_unixコマンド/ps_grep.txt
· 最終更新: 2015/08/25 05:19 by
matsui
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ