キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 
cancel
378
閲覧回数
0
いいね!
0
コメント
Taro Akai
Cisco Employee
Cisco Employee

StarOSでは、show commandの出力をgrepで操作できますが、オプションは限られています。

以下にいくつかの例を挙げます。 

grep for Regular Expressions (CLIマニュアルより抜粋)

The | grep has the following syntax:

| grep [ -E | -i | -n |-v | --extended-regexp | --ignore-case | --invert-match | --linenumber] expression

 

使用例:

① -i (ignore-case) 検索対象文字列のUpper/Lower caseを区別しない

# dir /flash/ | grep -i <Filename of image or config>

# show npu stats debug all | grep -i lag

# show logs | grep -i "slot 9"

 

② -v (invert-match) 検索対象文字列を含まない行を出力する

# show task resources | grep -v good

 

③ -E (extended-regexp) 複数指定した文字列のどれかを含む(OR)

# show diameter peers full | grep -E "Task|Host"

 

④ -n (linenumber) 検索対象文字列を含む行数を表示

 

Getting Started

検索バーにキーワード、フレーズ、または質問を入力し、お探しのものを見つけましょう

シスコ コミュニティをいち早く使いこなしていただけるよう役立つリンクをまとめました。みなさんのジャーニーがより良いものとなるようお手伝いします