WC

| | コメント(0) | トラックバック(0)

[root@localhost conf]# wc --help
使用法: wc [オプション]... [ファイル]...
Print newline, word, and byte counts for each FILE, and a total line if
more than one FILE is specified.  With no FILE, or when FILE is -,
read standard input.
  -c, --bytes            print the byte counts
  -m, --chars            print the character counts
  -l, --lines            print the newline counts
  -L, --max-line-length  最も長い行の長さを表示
  -w, --words            単語数を表示
      --help     この使い方を表示して終了
      --version  バージョン情報を表示して終了


[root@localhost conf]#

接続を調べたりするのに利用できる。

[root@localhost conf]# netstat -n | grep "/var/run/dbus/system_bus_socket" | wc -l
4
[root@localhost conf]# netstat -n | grep "/var/run/dbus/system_bus_socket"
unix  3      [ ]         STREAM     CONNECTED     7397   /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     6216   /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     6179   /var/run/dbus/system_bus_socket
unix  3      [ ]         STREAM     CONNECTED     5349   /var/run/dbus/system_bus_socket

 

[root@localhost conf]# netstat -n | grep 80 | wc -l

4

[root@localhost conf]# netstat -n | grep 22 | wc -l
1

 

以下のように,ファイルないに特定の文字列がいくつあるかCountする事も出来る。

wc.jpg


カテゴリ

トラックバック(0)

このブログ記事を参照しているブログ一覧: WC

このブログ記事に対するトラックバックURL: http://variable.jp/mt/mt-tb.cgi/29

コメントする

このブログ記事について

このページは、管理者が2007年9月29日 00:37に書いたブログ記事です。

ひとつ前のブログ記事は「正規表現 grep -v ^#」です。

次のブログ記事は「CUTコマンドで特定の文字を取り出す」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。

Powered by Movable Type 4.0